Hello!
I'm using a dynamic data chart from a Postgres database as the data source. A data point corresponds to a day. Clicking on a button changes the table from which the data is read. As a result, the x-axis is sometimes 5 years long and sometimes just 1 month long.
The chart is a line chart with markers. I want the markers to change size in steps when zooming, for example:
- if up to 60 data points are displayed, the markers should have a radius of 7.
- if between 61 - 500 data points are displayed, the markers should have a radius of 5
- if between 501 - 2000 data points are displayed, the markers should have a radius of 3
- etc...
I've tried a few things, but so far I've only managed to get the radius to be 3 when the entire chart is displayed and when you zoom, the radius changes to 5. But this is extremely impractical because, as I said, the length of the x axis differs greatly depending on the table and therefore the size of the markers is not applicable to everything.
In any case, the best way would be to count the displayed data points and adjust the marker size accordingly, but I absolutely can't get it to work.
Can someone give me an example of this please?