Jump to content
Software FX Community

Variable x values for series


garrettvm

Recommended Posts

 Can I have several series in a line chart with markerpoints where the series have a different number of values?

Could I have something like x=jan 1 2007 10AM, y = 100; x=jan 1 2007 3PM, y = 110; x=jan 2 2007 10AM, y = 105; x=jan2 2007 4PM, y = 120

for one series and say x=jan 1 2007 11AM, y = 80; x=jan 1 2007 3PM, y = 90;  x=jan2 2007 5PM, y = 82 for a second series.

 Actually I want 5 or 6 series like this with variable x values and a variable number of x values, so a different number of data points in each series and not all on the same x values?

 

Thanks.

Garrett 

Link to comment
Share on other sites

Yes. Each series cna have it own set of independent X-Values.

All series have the same number of points, however you can set the trailing values of the smaller series to Chart.Hidden to hide them.

For example:

// Series 1: (longer series)

chart.Value(0,0) = 10;

chart.XValue(0,0) = 1;

chart.Value(0,1) = 20;

chart.XValue(0,1) = 2;

chart.Value(0,2) = 30;

chart.XValue(0,2) = 3;

chart.Value(0,3) = 40;

chart.XValue(0,3) = 4;

// Series 2 (shorter series)

chart.Value(0,0) = 10;

chart.XValue(0,0) = 5;

chart.Value(0,1) = 20;

chart.XValue(0,1) = 8;

chart.Value(0,2) = Chart.Hidden; // Padding

chart.Value(0,3) = Chart.Hidden; // Padding

Link to comment
Share on other sites

  • 2 weeks later...

Frank, 

Thanks for your reply.

 

If I try:

 

chart1.Value[0,0] = 10;

chart1.XValue[0,0] = 1;

chart1.Value[0,1] = 20;

chart1.XValue[0,1] = 2;

chart1.Value[0,2] = 30;

chart1.XValue[0,2] = 3;

chart1.Value[0,3] = 40;

chart1.XValue[0,3] = 4;

// Series 2 [shorter series]

chart1.Value[1,0] = 50;

chart1.XValue[1,0] = 1;

chart1.Value[1,1] = 60;

chart1.XValue[1,1] = 2;

chart1.Value[1,2] = Chart.Hidden;

// Padding

// chart1.Value[1,3] = Chart.Hidden; // Padding

chart1.Value[1,3] = 80;

chart1.XValue[1,3] = 4;

so that the "missing point" in this case is in the middle I don't have a line going from point at chart1.XValue[1,1] = 2 to the point at chart1.XValue[1,3] = 4.

 So just the isolated point is graphed.

 

Actually my data is quite messy in that I have 5 series (think temperature, blood pressure etc.) and each series seems to be recorded at a different date/time which is the X axis for chart.

 I changed the [0,num] to [1,num] in the second series. Is this correct? Have two series both with the first subscript = 0 didn't seem to work.

 Any suggestions about how to graph my type of data?

 

thanks.

 

Garrett

Link to comment
Share on other sites

The padding goes at the end.

You wrote:

chart1.Value[1,2] = Chart.Hidden; // Padding

// chart1.Value[1,3] = Chart.Hidden; // Padding

chart1.Value[1,3] = 80;

 This is incorrect. You have 80 AFTER the hidden. In this case you get a break in the line. This is what you are instructing Chart FX to do. You must have all your hidden values at the END of the series. No value can come after a hidden otherwise you will get the break. You should be doing:

chart1.XValue[1,1] = 2;

 

chart1.Value[1,2] = 80;

chart1.XValue[1,2] = 4;

chart1.Value[1,3] = Chart.Hidden; // Padding

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...