Creating a Spark Win/Loss chart |
Here, we'll create a simple spark win/loss chart to show the performance of Yankees this season. The chart will look as under: |
|
Data for the chart |
Our fictional season's data can be converted into XML/JSON as under: |
<chart caption="Yankees" subcaption="Current season"> { "chart": { "caption": "Yankees", "subcaption": "Current season" }, "dataset": [ { "data": [ { "value": "W" }, { "value": "W" }, { "value": "D" }, { "value": "L" }, { "value": "W" }, { "value": "W" }, { "value": "L" }, { "value": "L" }, { "value": "W" }, { "value": "L" }, { "value": "W", "scoreless": "1" }, { "value": "L" }, { "value": "W" }, { "value": "W" } ] } ] } |
In the above XML, we've:
For detailed explanation on JSON data format click here. When you now view the chart, you'll get something as under: |
See it live! Next, we'll see how to configure the various aspects of this chart. |