We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sample Data for Stacking Bar/Column series

Can someone please provide sample data for stacking bar/column series? Something like the following will suffice:
...
SampleData = new ObservableCollection();
SampleData.Add(new ChartDataPoint("YValue", x1, x2));
The issue with this data is that it only displays the x1 value - x2 is not stack in a different color.
Thanks!

3 Replies

SP Saravana Pandian Murugan Syncfusion Team June 23, 2016 10:31 AM UTC

Hi Drew,

We have prepared a sample based on your requirement which can be downloaded from the below location.

Sample: http://www.syncfusion.com/downloads/support/forum/124687/ze/StackedBarSample-2059730491  

Thanks,
Saravana Pandian M. 



DW Drew Wilson June 23, 2016 05:10 PM UTC

This worked perfectly.

Just to further clarify for those interested it the addition of a second data set that stacks the values:

            series1Data = new ObservableCollection<ChartDataPoint>();
            series2Data = new ObservableCollection<ChartDataPoint>();

            series1Data.Add(new ChartDataPoint("John", 25));

            series2Data.Add(new ChartDataPoint("John", 45));

will create a stacked bar for John


SP Saravana Pandian Murugan Syncfusion Team June 24, 2016 05:25 AM UTC

Hi Drew,

Thanks for the update.

Yes. The bar will be stacked for John.

Thanks,
Saravana Pandian M.


Loader.
Up arrow icon