XY Chart data aggregation

Charts for WPF Forum

Posted 5 years ago by Michael Holland
Version: 19.1.0681
Avatar

I'm trying to understand exactly what happens with the data points plotted on an XY chart which uses aggregation. The documentation states,

"In order to increase performance, the chart control will automatically determine the optimal number of data points to display based on the size of the control. This is determined using the AggregationFactor property, which defaults to 0.2.

For example, if the chart control is 100 pixels wide and uses an aggregation factor of 0.1, then the optimal number of data points would be 10. If the data source contained 1000 items, then the chart would create 10 groups, each with 100 items in it. Then some sort of aggregation function would be performed on each group to generate a single data point for display."

(It then goes on to explain the aggregation function which is used.)

So say we have a chart plotting temperature against time. The data source contains the temperature for the last three hours, one point per minute, therefore 180 points. The chart is 800 pixels wide and the aggregation factor is 0.2. The "optimal number of data points" would be 160.

Does that mean that 160 data points would be plotted on the chart? How many points would be in each group? Which points would fall into which groups? And how would the data be aggregated?

Comments (3)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Michael,

It would take the total source data point count (180) and would divide by the optimal number of data points (160) to determine how many data points are in each group.  The group size is an integer and should end up being 1 here.  Therefore in this scenario, I don't believe aggregation will end up occurring since this there is a single data point in each group and it would try to plot 180 groups.

If your source data point count was 320, the group size would be 2.  It would group each two subsequent (within the source) data points into a group.  And the aggregation kind would be applied to each pair of points to end up plotting 160 groups.

I hope that helps explain things.


Actipro Software Support

Posted 5 years ago by Michael Holland
Avatar

Hi, that does help a bit, thanks. But would it be possible to state the actual algorithm used to calculate the aggregation? Your answer suggests it divides the source data point count by the optimal number number of data points and rounds it to an integer. What sort of rounding is applied?

That is the real point I am trying to get to because our customers need to know what happens when real data points are fed in, what will actually be displayed. Obviously, the number of data points is rarely going to be an exact multiple of the optimal number. To be able to validate that the graph is a true reflection of what happened in the data we need to show what is actually happening.

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

It's doing an integer division of "source data point count" by "optimal number of data points" to calculate the group size, so it will always round down. 

When building the groups, it's dividing the integer collection index of each data point by the integer group size, and is putting data points with the same results of that operation in the same "group".


Actipro Software Support

The latest build of this product (v24.1.3) was released 26 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.