Chart for WinForms

adding a new Series in Chart Control

  •  pdthekd said 1 year ago:

    i’m new to Chart Control so i need some help

    i have declared and created a new series in a event lets say FormLoad event. i want to use the same series to be used in an other event how can i do it

    eg:

    public void Form1_Load(object sender, EventArgs e)
            {
                Series Series1 = new Series();
                Series1.Name = "Series#";
                Series1.ChartArea = "ChartArea1″;
    .
    .
    .
    
                 Series1.Points.AddXY(varX, varY);  
    .
    .
    .
                   Chart1.Series.Add(Series1);
             }

    i want this Series1 to be available even in other events(like some public variable) how do i do it please help

  •  Ashish Jindal16p said 1 year ago:

    Hello,

    I am not sure if you are using C1Chart control of Winforms but if you want to access the series from any other event then you may access it by indexing through Series collection. The code may look like:

     Series Series1 = Chart1.Series[0];
    

    Regards
    Ashish

    Answer
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.