Hi,
I am populating a column chart programatically from the data returned from service. The following xaml will explain how the data is coming back from the service.
<igChart:XamWebChart.Series> <igChart:Series Label="Open" DataPointStyle="{StaticResource ColumnChart}" ChartType="Column"> <igChart:Series.Animation> <igChart:Animation /> </igChart:Series.Animation> <igChart:Series.Fill> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FF358ECA" /> <GradientStop Color="#FF014E7C" Offset="1" /> </LinearGradientBrush> </igChart:Series.Fill> <igChart:Series.DataPoints> <igChart:DataPoint Label="Jan" Value="25" /> </igChart:Series.DataPoints> </igChart:Series> <igChart:Series Label="Active" ChartType="Column" DataPointStyle="{StaticResource ColumnChart}"> <igChart:Series.Animation> <igChart:Animation /> </igChart:Series.Animation> <igChart:Series.Fill> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFA7D912" /> <GradientStop Color="#FF496100" Offset="1" /> </LinearGradientBrush> </igChart:Series.Fill> <igChart:Series.DataPoints> <igChart:DataPoint Label="Feb" Value="15" /> </igChart:Series.DataPoints> </igChart:Series> </igChart:XamWebChart.Series>
Now the problem with this is, chart renders only 1 point in x-axis with 2 values, where as it should have rendered 2 points. Please let me know if this is a bug and if you have any work-around for this.
Thanks,Apratim
Apratim,
For this kind of series, the labels are going to be based of the first series in the chart, and there is the assumption that the seperate series will be aligned in terms of label, so something like this:
<igChart:XamWebChart>
<igChart:XamWebChart.Series>
<igChart:Series Label="Open" ChartType="Column">
<igChart:Series.Animation>
<igChart:Animation />
</igChart:Series.Animation>
<igChart:Series.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF358ECA" />
<GradientStop Color="#FF014E7C" Offset="1" />
</LinearGradientBrush>
</igChart:Series.Fill>
<igChart:Series.DataPoints>
<igChart:DataPoint Label="Jan" Value="25" />
<igChart:DataPoint Label="Feb" Value="0" />
<igChart:DataPoint Label="Mar" Value="14" />
</igChart:Series.DataPoints>
</igChart:Series>
<igChart:Series Label="Active" ChartType="Column" >
<GradientStop Color="#FFA7D912" />
<GradientStop Color="#FF496100" Offset="1" />
<igChart:DataPoint Label="Jan" Value="0" />
<igChart:DataPoint Label="Feb" Value="15" />
<igChart:DataPoint Label="Mar" Value="18" />
</igChart:XamWebChart.Series>
</igChart:XamWebChart>
probably renders more in the way you would expect. You can fill out missing values in either series with 0 values.
-Graham
Hi Gullam,
I pretty much figured that peice by looking at the examples. But do you really think its a correct aprroach? I am calling a service, which can give me n number of series and n number of data points. Also if you see your object model they perfectly allow you to do so. Then while painting why it would only consider first series data points label.
Also if i remember correctly all other version of charting products support this kind of data and if you think it though to make sure all the series and all the data points have value its very simple to acheive it as well, where you dont know how many and what series and datapoint data is coming your way.
Let me know if you can think of any workarounds. Our scenario is we fetch data from SQL using group by and return it as a LIST<T> from the service.
Thanks, Apratim
test