Multiple Y Items Per X Item

Thread is closed for posting
3 posts, 1 answers
  1. James
    James avatar
    7 posts
    Member since:
    Sep 2007

    Posted 28 Sep 2009 Link to this post

    Is the relationship between X and Y items on a chart 1 to 1?

    I have data that looks like this:

    Cnt      Date               Week
    1         09/23/2009     09/20/2009
    1         09/24/2009     09/20/2009
    4         09/25/2009     09/20/2009
    11       09/28/2009     09/27/2009

    I am doing a line chart and would like to have two "X" items from the data above: 9/20/2009 and 9/27/20009. The 9/20/2009 x item would have the three appropriate Y entries. Is it possible to group Y items into X items in this manner?

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

    Posted 29 Sep 2009 Link to this post

    You can have multiple y-values per x-value. How you implement this is kind of up to you, but to define this all manually you could do:

     
    ChartSeriesItem mySeriesItem = new ChartSeriesItem(); 
    ChartSeries myFirstSeries = new ChartSeries(); 
    mySeriesItem.XValue = x; 
    mySeriesItem.YValue = y;
    myFirstSeries.Items.Add(mySeriesItem);

    Also, since you are using dates I would recommend looking into this demo since it deals with numerical representations of dates on the axis.


  3. James
    James avatar
    7 posts
    Member since:
    Sep 2007

    Posted 29 Sep 2009 Link to this post

    Cool..thanks much, Schlurk.
Back to Top