FusionCharts - Customizing Period blocks in Spark Win/Loss chart

Created using FusionCharts Suite XT - www.fusioncharts.com

by FusionCharts

HTML

<script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<!--Customizing Period blocks in Spark Win/Loss chart using attributes:

      # periodlength - To show period blocks on the chart. This helps interpret periods on the chart.
    # periodcolor - Fill color of the period blocks (In Hex)
    # periodalpha - Alpha of the period blocks (0-100)

    Deviation from theme
        # chartBottomMargin
-->
<div id="chart-container">FusionCharts will render here</div>

JavaScript

FusionCharts.ready(function() {
  var winLossChart = new FusionCharts({
      type: 'sparkwinloss',
      renderAt: 'chart-container',
      width: '450',
      height: '70',
      dataFormat: 'json',
      dataSource: {
        "chart": {
          "theme": "fusion",
          "caption": "Bobby Fischer (vs. Spassky)",
          "subcaption": "World Chess Championship 1972",
          "subCaptionFontSize": "11",
          "numberPrefix": "$",
          "chartBottomMargin": "20",
          //Setting period length (Period defined as a set of 3 match)
          "periodlength": "3",
          //Defining period color
          "periodcolor": "#cccccc",
          //Setting period transparency
          "periodalpha": "90",
        },
        "dataset": [{
          "data": [{
              "value": "L"
            },
            {
              "value": "L"
            },
            {
              "value": "W"
            },
            {
              "value": "D"
            },
            {
              "value": "W"
            },
            {
              "value": "W"
            },
            {
              "value": "D"
            },
            {
              "value": "W"
            },
            {
              "value": "D"
            },
            {
              "value": "W"
            },
            {
              "value": "L"
            },
            {
              "value": "D"
            },
            {
              "value": "W"
            },
            {
              "value": "D"
            },
            {
              "value": "D"
            },
            {
              "value": "D"
            },
            {
              "value": "D"
            },
            {
              "value": "D"
            },
            {
              "value": "D"
            },
            {
              "value": "D"
            },
            {
              "value": "W"
            }
          ]
        }]
      }
    })
    .render();
});