Jump to content
Software FX Community

Multiple series with variable number of points?


User (Legacy)

Recommended Posts

I'm trying to create a chart that has multiple lines (series). I have

"quantity" on the Y-axis and datetime on the X-axis. The X-axis spans a

specified date range and the X values can take any value in that range and

have any number of points. Can I plot multiple such series on the one chart?

If so, how do I specify the OpenData method parameters if I have a different

number of points per series?

TIA

Link to comment
Share on other sites

You specify the biggest number of points as the number of points in

OpenDataEx.

Then you will assign X and Y values for each series up to where you have

data for them, the rest of the values you can fill with CHART_HIDDEN so that

they will not appear in the chart.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Thank you. I'm afraid I'm still somewhat bewildered.

If I want a line graph that plots stock level (for instance) against

datetime, how do I do this if my stock data is taken at irregular intervals?

I wish the X axis labels/ticks to be regular, but the actual X position

interval between points may be a few hours in one case and a few days in

another, etc.. Is this an XY plot? Are there any examples?

TIA

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:yJ%23STU1NDHA.3180@webserver1.softwarefx.com...

> You specify the biggest number of points as the number of points in

> OpenDataEx.

>

> Then you will assign X and Y values for each series up to where you have

> data for them, the rest of the values you can fill with CHART_HIDDEN so

that

> they will not appear in the chart.

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

You achieve this using X-Values, you can set the X-Value of each point using

the XValue property or through data-binding (see docs for details).

Some gallery types, however don't support X-Values, the following Chart Type

support X-Values:

Scatter

Lines

Step

Area

Surface

Curve

Curve-Area

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Thank you. I have attempted to do this with chart of type "Lines" and

setting the XValue to a date but it doesn't seem to work. Some of my code...

Chart1.ClearData(ClearDataFlag.AllData);

Chart1.Gallery = Gallery.Lines;

Chart1.AxisY.LabelsFormat.Format = AxisFormat.Number;

Chart1.AxisX.LabelsFormat.Format = AxisFormat.Date;

Chart1.OpenData(COD.Values, SeriesCount,(int)COD.Unknown);

Chart1.OpenData(COD.XValues, SeriesCount,(int)COD.Unknown);

int PointNo = -1;

foreach(object objPoint in SeriesData.Points)

{

ChartSeriesPointInfo ThisPoint = (ChartSeriesPointInfo)objPoint;

Chart1.Value[seriesNo, ++PointNo] = ThisPoint.TheQuantity;

Chart1.XValue[seriesNo, ++PointNo] = ThisPoint.TheDate.ToOADate();

}

Chart1.CloseData(COD.Values);

Chart1.CloseData(COD.XValues);

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:0RB3ab2NDHA.3328@webserver1.softwarefx.com...

> You achieve this using X-Values, you can set the X-Value of each point

using

> the XValue property or through data-binding (see docs for details).

>

> Some gallery types, however don't support X-Values, the following Chart

Type

> support X-Values:

>

> Scatter

> Lines

> Step

> Area

> Surface

> Curve

> Curve-Area

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

This code looks fine, what's the problem ? In your first posting you stated:

"I have a different

number of points per series?" I suggested a course of action for having

different series with different number of points using Chart.Hidden.

I don't see any of that in this code.

So I guess my question is back to the beginning. What's the problem ? Please

attach a screenshot of what you are getting along with a binary file of the

chart you currently have. You can obtain a binary file of the chart by

calling the Export method.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Sorry, I made a stupid mistake. I incremented PointNo twice. Duh! It's

working now. One last question, if I may... Can I combine a bar chart on the

same chart as an XY plot? If so, how do I assign the bar chart XValue?

Thanks again.

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:Z0QbAlZODHA.2964@webserver1.softwarefx.com...

> This code looks fine, what's the problem ? In your first posting you

stated:

> "I have a different

> number of points per series?" I suggested a course of action for having

> different series with different number of points using Chart.Hidden.

>

> I don't see any of that in this code.

>

> So I guess my question is back to the beginning. What's the problem ?

Please

> attach a screenshot of what you are getting along with a binary file of

the

> chart you currently have. You can obtain a binary file of the chart by

> calling the Export method.

>

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...