mardi 10 juin 2014

Custom line chart series.

I have a line chart in my application. I am able to add multiple series to it. My requirement is to create series for the selected time period. For example, my store has data for 5 years(2008, 2009, 2010, 2011, 2012). For every year there are 3 columns [Data1, Data2, Data3]. I am able to create series for Data1, Data2 and Data3. The problem is I have to create series for Data2 and Data3 for only 3 and 4 years respectively. For Data2 I need to create series for 2010, 2011 and 2012. Similarly for Data3 I need to create series for 2009, 2010, 2011 and 2012. How can that be achieved? Here is the sample JSON I have for my store.

Code:



[
{
"Year": "2008",
"Data1": 100,
"Data2": 200,
"Data3": 300,
},
{
"Year": "2009",
"Data1": 110,
"Data2": 210,
"Data3": 310,
},
{
"Year": "2010",
"Data1": 120,
"Data2": 220,
"Data3": 320,
},
{
"Year": "2011",
"Data1": 130,
"Data2": 230,
"Data3": 330,
},
{
"Year": "2012",
"Data1": 140,
"Data2": 240,
"Data3": 340,
}



]




Aucun commentaire:

Enregistrer un commentaire