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
close icon

Dynamic Series

hi ,

How to create a series dynamically  in code behind for chart.
Please help me.

thank You ,
Vijayakumar.s

5 Replies

DP Deepaa Pragaasam Syncfusion Team October 23, 2015 01:39 PM UTC

Hi Vijayakumar,
Thanks for contacting Syncfusion Support.
We have analyised your query and created a sample to add series dynamically in the code behind technique.
We have created the series object in code behind and added data to it.
Code Example:
[Default.aspx.cs]

  

Series series1 = new Series();

            series1.Type = Syncfusion.JavaScript.DataVisualization.SeriesType.Column;


            //Add Chart data

            List<Data> data1 = new List<Data>();


            Random yValue = new Random();


            for (int i = 0; i < 20; i++)

            {

                data1.Add(new Data(i, yValue.Next(10, 50)));

            }


            //DataSource Bind to the Series

            this.Chart1.Series.Add(series1);


            //Bind DataSource for Series 1

            this.Chart1.Series[0].DataSource = data1;

            this.Chart1.Series[0].XName = "Xvalue";

            this.Chart1.Series[0].YName = "YValue1";
            this.Chart1.DataBind();
Screenshot:

We have prepared a sample according to your requirement
 https://www.syncfusion.com/downloads/support/forum/120868/ze/WebApplication643790636
Please let us know if you have any concerns
Regards,
Deepaa.



VI Vijaykumar October 25, 2015 04:09 AM UTC

Hi Deepaa ,

Thanks for your quick response. 


VI Vijaykumar October 26, 2015 04:32 AM UTC

hi ,
Please send the same code for VB.net

thank You,
Vijayakumar.s


VI Vijaykumar October 26, 2015 04:47 AM UTC

hi ,

VB.NET code not needed sorry for the inconvenience case 


PG Pon Geetha A J Syncfusion Team October 26, 2015 06:45 AM UTC

Hi VIjaykumar,
 
Thanks for the update. Please let me know if you need any further assitance.
 
Regards,
Geetha

Loader.
Live Chat Icon For mobile
Up arrow icon