Friday, November 17, 2006

Multiple Series Graphs
so far I have tried 2 technologies for adding graphs to my .net sites, I used the dotnetcharting component http://dotnetcharting.com/ and I also used the fusion flash component http://www.infosoftglobal.com/FusionCharts/ , they are both great, but when it comes to having multiple series, here comes the challenge !
the graphs XAxis points must be defined regardless of the different series added to the graph, in the first technology, the dotnetcharting component, it takes the first series data and it uses it as the base for the XSeries points. For the second technology, the fusion charts, it takes a XML element that defines the points on the XAxis.

It's very difficult if the values of XAxis among different serieses are not similar, and you have to add your own logic to handle it. so you start first by having a unique set of all points for the XAxis for all serieses, and then you order it. For example, lets assume that you have series1 and series 2,

series1 has the values for XAxis: Jan,Feb,March
series2 has the values for XAxis: March,Feb,April

so you will first need to define the unique elements: Jan,Feb,March,Apr. then you will need to order it. and also you might want to fill in the gaps for missing xaxis values, like in series2, it does not have the "Jan" values, so you will need to add it, and you will set it's value to 0.

It's not straight forward, but it's doable, hopefully I was able to make things more clear...