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

Column Chart

Hi,

My only question is Can I add 3 or more columns in Column Chart and How?

Regards.


3 Replies

MP Michael Prabhu M Syncfusion Team May 2, 2012 09:36 AM UTC

Hi Salih,

Thanks for using Syncfusion product,

You requirement can be achieved by adding multiple chart series to our chart area, as in below code snippet.

Code Snippet[Xaml]:








Based on your requirement we have created a simple sample, Please find the attached sample below.

Please let us know if you have any queries.

Thank,
Michael Prabhu.



CS_a7fe84cf.zip


SA Salih May 3, 2012 07:26 AM UTC

Hi,

Thanks for your answer. But I want to add these columns by variables. For example, I use columnCount variable (int columnCount). I want to change these colums depends on this columnCount variable.

Thank you so much for your help.

Best Regards.



MP Michael Prabhu M Syncfusion Team May 8, 2012 05:43 AM UTC

Hi Salih,

Thanks for using Syncfusion Products.

We have analyzed your requirement and it can be achieved by adding Column Series to the chart area with respect to the number of columnCount variable as in below code snippet.

Code Snippet [C#]:
public void ADDColumns(int columnCount)
{
for (int i = 0; i < columnCount; i++)
{
ChartSeries newseries= new ChartSeries();
newseries.Type = ChartTypes.Column;
newseries.BindingPathX= "Prodname";
newseries.BindingPathsY= new string[]{"Price200"+i.ToString()};
newseries.DataSource = ab.Products;
Chart1.Areas[0].Series.Add(newseries);
}
}

Based on your requirement we have created a simple sample which you can download from the link below.

Sample: ColumnChart.zip

Please let us know if you have any queries.

Thanks,
Michael Prabhu.


Loader.
Live Chat Icon For mobile
Up arrow icon