This is a migrated thread and some comments may be shown as answers.

Multiple Y Items Per X Item

2 Answers 48 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 28 Sep 2009, 09:55 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Schlurk
Top achievements
Rank 2
answered on 29 Sep 2009, 01:53 PM
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.


0
James
Top achievements
Rank 1
answered on 29 Sep 2009, 03:13 PM
Cool..thanks much, Schlurk.
Tags
Chart (Obsolete)
Asked by
James
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
James
Top achievements
Rank 1
Share this question
or