Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create column chart with custom downsampling #1789

Open
hernes45 opened this issue Nov 18, 2024 · 1 comment
Open

How to create column chart with custom downsampling #1789

hernes45 opened this issue Nov 18, 2024 · 1 comment
Labels

Comments

@hernes45
Copy link

Question
Depending on the data I can have different granularity in the same column chart. My use case is that my source of data sometimes returns the data in hourly mode, daily mode or 15 minutes mode.

So I have two questions:

  • Is there any way to make the chart autodiscover the granularity of the data? that means autosize the columns depending on the amount of data and the period requested. I haven't found this.
  • the Work arround to make it work is to put the data always as "hourly", which is ok for me. The problem comes with the 15 minutes data that makes a downsampling taking the bigges value withing the hour. Is there anyway to customize this aggregation? Could i configure it to be a Sum, an Average, or another mathematical function?

Here is an example of the aggregation by Week have samples in daily mode, it reprensets only the biggest in each period.
https://jsfiddle.net/1mtsLyak/1/

@martynasma
Copy link
Collaborator

Is there any way to make the chart autodiscover the granularity of the data?

No, I'm afraid there's not built-in function to discover granularity of data.

Is there anyway to customize this aggregation? Could i configure it to be a Sum, an Average, or another mathematical function?

Have you tried enabling data item grouping? I mean forcing hourly grouping, so that all 15-min data items are aggregated into a single data point as per your rules.

https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#forcing-group-interval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants