Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
780
Unexpected behavior with multiple series in a chart.
posted

If I add multiple series to a chart and the labels for the series don't completely sync up, it seems the data is rendered incorrectly.  In the chart below series 1 has labels "Mark" and "Sue".   Series 2 has labels "Mark" "Bob" and "Joe".   When the chart is rendered I would expect the data to be treated as 4 rows: Mark, Sue and Bob, Joe.  But instead, only 3 rows are displayed and the labels are Mark, Sue and "3".  And Sue gets Bob's value for series 2. 

It appears the chart is taking the first series as the basis for the rows, and then assuming the 2nd series has the same rows ordered in the same exact order.  When there are more rows in a 2nd (or later) series, it does add a new row, but does not use the label associated with it. 

I would expect it to use the label values to cluster the data, not the order of the data points in the series.  This puts the burden of handling missing data on the code generating the multiple series of data, rather than handling in the chart. 

<igChart:XamWebChart x:Name="XamWebChart1" Margin="10,0,0,0">
    <igChart:XamWebChart.Series>
        <igChart:Series ChartType="Bar" Label="Series 1" >
            <igChart:Series.DataPoints>
                <igChart:DataPoint Value="50" Label="Mark" />
                <igChart:DataPoint Value="40" Label="Sue" />
            </igChart:Series.DataPoints>
        </igChart:Series>
        <igChart:Series ChartType="Bar" Label="Series 2" >
            <igChart:Series.DataPoints>
                <igChart:DataPoint Value="10" Label="Mark" />
                <igChart:DataPoint Value="23" Label="Bob" />
   <igChart:DataPoint Value="10" Label="Joe" />
            </igChart:Series.DataPoints>
        </igChart:Series>
    </igChart:XamWebChart.Series>
</igChart:XamWebChart>

When I use this same series data with the Silverlight Toolkit charts, I get the results as I would expect.  4 clusters, 1 for Sue, Joe, Bob and Mark.  Mark has data for both series, the rest only for 1.  I can send a simple repro of that if needed. 

So, I guess a couple questions: 

1.  Is this expected behavior, or a bug?
2.  If expected, is there a way I can get the behavior that the SL toolkit charts have, which is what I want?

Thanks,
Keith

Parents Reply Children
No Data