Jump to content
Software FX Community

missing data points on a line chart


User (Legacy)

Recommended Posts

I am trying to create a multi-series line chart where values may not be

available for all series for a given x-axis point. If I use Chart.Hidded for

a particular series value to hide it, the line for this series gets

"interrupted". See http://www.liquidhome.com/~lvi/chartfx/bad.jpg for an

example.

I can use some simple math to interpolate the missing values and produce

the result I need http://www.liquidhome.com/~lvi/chartfx/good.jpg , but the

code is rather complicated and hard to maintain.

I am just wondering, may be there is some option in ChartFX which would

allow me to achieve the same result without interpolating the missing values

manually?

Ilya

Link to comment
Share on other sites

Set your gallery type to Lines (it is probably a scatter chart now).

--

Regards,

JC

Software FX Support

"Ilya Languev" <junk@liquidhome.com> wrote in message

news:A01uCMaQDHA.1300@WEBSERVER1....

> I am trying to create a multi-series line chart where values may not

be

> available for all series for a given x-axis point. If I use Chart.Hidded

for

> a particular series value to hide it, the line for this series gets

> "interrupted". See http://www.liquidhome.com/~lvi/chartfx/bad.jpg for an

> example.

>

> I can use some simple math to interpolate the missing values and

produce

> the result I need http://www.liquidhome.com/~lvi/chartfx/good.jpg , but

the

> code is rather complicated and hard to maintain.

>

> I am just wondering, may be there is some option in ChartFX which

would

> allow me to achieve the same result without interpolating the missing

values

> manually?

>

> Ilya

>

>

Link to comment
Share on other sites

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

news:yLuJz4bQDHA.1220@WEBSERVER1....

> Set your gallery type to Lines (it is probably a scatter chart now).

No, it is set to Lines.

This example is better: http://www.liquidhome.com/~lvi/chartfx/bad1.jpg

Notice how Series #2 line is broken in the middle because of the missing

value for LOT_11 set to Chart.Hidden.

The question is whether I can make ChartFX to connect the green line

from LOT_10 to LOT_12 without providing the value for LOT_11.

In other words, I need this:

http://www.liquidhome.com/~lvi/chartfx/good1.jpg

Ilya

>

> --

> Regards,

>

> JC

> Software FX Support

> "Ilya Languev" <junk@liquidhome.com> wrote in message

> news:A01uCMaQDHA.1300@WEBSERVER1....

> > I am trying to create a multi-series line chart where values may not

> be

> > available for all series for a given x-axis point. If I use Chart.Hidded

> for

> > a particular series value to hide it, the line for this series gets

> > "interrupted". See http://www.liquidhome.com/~lvi/chartfx/bad.jpg for

an

> > example.

> >

> > I can use some simple math to interpolate the missing values and

> produce

> > the result I need http://www.liquidhome.com/~lvi/chartfx/good.jpg , but

> the

> > code is rather complicated and hard to maintain.

> >

> > I am just wondering, may be there is some option in ChartFX which

> would

> > allow me to achieve the same result without interpolating the missing

> values

> > manually?

> >

> > Ilya

> >

> >

>

>

Link to comment
Share on other sites

The line will break at hidden points. This is precisely what hidden points

are used for.

If you want the line to be continuous, don't insert hidden points in the

middle, instead assign the X-Value appropriately.

For example, if you have data for X = 1, 3, 5, 7, 19 you assign the X-values

to 1, 3, 5, 7 and 19. So you end up with a chart that has only 5 points,

instead of 19 points and "holes" in between the points.

You can then use Hidden values only at the end of series that are shorter

than others.

--

FP

Software FX, Inc.

Attachments.zip

Link to comment
Share on other sites

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

news:EK8CDkkQDHA.1220@WEBSERVER1....

> The line will break at hidden points. This is precisely what hidden points

> are used for.

>

> If you want the line to be continuous, don't insert hidden points in the

> middle, instead assign the X-Value appropriately.

>

> For example, if you have data for X = 1, 3, 5, 7, 19 you assign the

X-values

> to 1, 3, 5, 7 and 19. So you end up with a chart that has only 5 points,

> instead of 19 points and "holes" in between the points.

>

> You can then use Hidden values only at the end of series that are shorter

> than others.

I do not quite get what you mean by "X-Value". I assume it is NOT the

SoftwareFX.ChartFX.Chart.XValue collection since it is used for scatter X/Y

plots and I need a line chart.

If I initialize my chart this way:

chart1.OpenData(SoftwareFX.ChartFX.COD.Values, 2, 20);

for( int nValue = 0; nValue < 20; nValue++ )

{

int nSeries = nValue % 2;

chart1.Value[nSeries,nValue] = (nSeries == 0 ) ? 50 : 100;

}

chart1.CloseData(SoftwareFX.ChartFX.COD.Values);

... then I'm getting some garbage Y-values for even X-values on the first

(blue) series and for odd X-values on the second (green) series:

http://www.liquidhome.com/~lvi/chartfx/garbage.jpg

If I use ClearData to wipe the values before calling OpenData:

chart1.ClearData(SoftwareFX.ChartFX.ClearDataFlag.Values);

... then I am getting zeroes instead of the garbage

http://www.liquidhome.com/~lvi/chartfx/zeroes.jpg.

But no matter what I do, I do not get the right result

http://www.liquidhome.com/~lvi/chartfx/good2.jpg without "faking" the

missing values.

But

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...