Series click on aggregated chart

1 Answer 116 Views
Charts
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
Ilan asked on 07 Jun 2023, 07:35 AM

I'm using a chart with BaseUnit="ChartCategoryAxisBaseUnit.Fit"

Aggregate="ChartSeriesAggregate.Sum",   Type="ChartCategoryAxisType.Date"

When clicking on a series it returns a single date (day)  and not the date range that were used for the aggregation.

 

I need the range in order to show the full result list in a grid.

 

How can it be done?

Yanislav
Telerik team
commented on 12 Jun 2023, 06:42 AM

Hello Ilan,

Correct me if I misunderstood something, but based on the description, I understand that you are trying to display the aggregate value for a specific range instead of for a certain date. Is that correct?

In general, the purpose of an aggregate is to convert a collection of values into a single value for a specific point. Since there are multiple values for the same category, one of them needs to be plotted (and the choice is determined by the aggregate function). The chart then continues to work with that point, not the range.

However, since the chart is currently not functioning in this way and the click event only returns the category it is working with, I suggest logging a feature request in our feedback portal - https://feedback.telerik.com/blazor
If you decide to log it, please elaborate more on how you envision this functionality to work.

The feature requests logged in the portal are reviewed and evaluated by the Telerik Blazor team. After that, based on the interest the community shows in them, they are planned accordingly for implementation in subsequent releases.

1 Answer, 1 is accepted

Sort by
0
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
answered on 12 Jun 2023, 06:56 AM

1. In that case, is there a way to know how the aggregate function works? or create a custom one?

2. There's no way to know the original points or at least get the current base unit ? (days, month etc)

Yanislav
Telerik team
commented on 14 Jun 2023, 01:58 PM

Hello Ilan,

Given that the click handler currently returns the plotted category, a possible solution would be to prepare the data in advance and directly pass it to the Chart. This way, you can perform the necessary aggregate operations and preserve the ranges for each category.

Here is a simple example that demonstrates this approach: https://blazorrepl.telerik.com/mHugFovH38sIS5Cb53

 

Tags
Charts
Asked by
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
Answers by
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
Share this question
or