adding a data point into chart

Thread is closed for posting
2 posts, 0 answers
  1. TMLP
    TMLP avatar
    38 posts
    Member since:
    Jul 2009

    Posted 09 Dec 2009 Link to this post

    Hi there,

    I am a bit confused about how to add a data point to the chart.  As in MS products, I would do MyChart.Series["SeriesName"].Points.AddXY(....)

    When I want to manually add a X and a Y value such as (X = "ProductA" , Y = 50) and (X= "ProductBB", Y =100), how would you do?

    Thanks.
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 10 Dec 2009 Link to this post

    This is how you can manually add items to a series:

     
    myFirstSeries = new ChartSeries(); 
    mySeriesItem = new ChartSeriesItem(); 
    mySeriesItem.XValue = 10; 
    mySeriesItem.YValue = 5; 
    myFirstSeries.Items.Add(mySeriesItem); 

    Although I just set up a new series object you can always just use a predefined series and add items to it this way :)
Back to Top