Page 1 of 1

Sparse data and TreatNulls?

Posted: Tue Apr 21, 2009 11:23 pm
by 14047359
I've got a chart displaying multiple series. The area style for each is set for CustomStack.Stack. Each series contains multiple subranges of valid values. I would like to have only those values graphed. So I might have the following data for one series.

{0, 1}
{1, 3}
{2, 2}

{10, 4}
{11, 2}
{12, 3}
{13, 3}

{22, 2}
{23, 4}

Y == 0 is the min for the y axis, and gaps in data correspond to points where y == 0. There will be something on the order of 10 non-represented "zero" points for each non-zero point.

And there will be multiple series, each with sparse data, but the gaps may not align on the x axis.

These points are not data bound, but rather they are added at runtime using series.Add(x,y).

Plus the transitions to/from zero are desired to be vertical, no slope, though this is not really important due to the data granularity.

Any suggestions other than to fill in the gaps with points where Y == 0? It seems that TreatNullsStyle.DoNotPaint does not help here.

Posted: Wed Apr 22, 2009 12:30 am
by 14047359
I've also tried the stacked bar style, which I thought might be more agreeable with the sparse data.

Seems this just doesn't work well with the stacking. Is it necessary to add matching "zero" entries in each series for each non-zero entry in a different series?

Posted: Wed Apr 22, 2009 10:31 am
by 10050769
Hello Russ,

When you drawing series stacked you have two things in mind :

First:

The number of points there are the same, you could that put null or "zeros" points in the series that you not want more points.

Second:

It's more important for series drawing stacked that all series are same x values, because there are different points x the series not draw one over the other.
Seems this just doesn't work well with the stacking. Is it necessary to add matching "zero" entries in each series for each non-zero entry in a different series?
Yes, As I explain previous.


Thanks,

Posted: Wed Apr 22, 2009 7:42 pm
by 14047359
Thanks, that's pretty much the conclusion I came to yesterday. In fact, I already implemented it and it seems to work well enough. Because the data is so sparse, I still store and wire transfer only non-zero sub-ranges, but when I load the chart, I process those into contiguous series data. Just feels wrong to generate (potentially) tens of thousands of zero values for EACH series (may be up to 20+ series!), depending on chart scale. We'll see how it affects real world usage, but because of this, I may now have to implement some sort of down sampling for cases where the x axis scale is larger than some as yet undefined limit.

Posted: Thu Apr 23, 2009 10:17 am
by narcis
Hi Russ,

You may be interested in TeeChart's existing DownSampling features. You'll find examples at All Features\Welcome !\Functions\Extended\Reducing number of points