G'day,
I am trying to use an ej.charts.Chart so that I can show number of
connections on a specific timeframe. I've got this working, looking like this:
What I cannot get to work is the behaviour of re-querying the datasource once the user uses the 'zoom' functionality.
At the moment, after zooming (
),
the data is the same as the above, just 'zoomed in / magnified':
The bar showing 30, should (after zooming) be multiple bars making
up 30 in total and should look something like this:
I have millions of connections to show, therefore the backend system
aggregates the data so that a max of 200 bars are shown on the x-axis. Therefore I
need to re-query the datasource / backend system once a user has selected a timeframe so I can return the additional details.
I would appreciate any help on how I can code the chart, so that after a
zooming event, it re-queries the datasource to get the additional
details for that selected timeframe.
Below is the code I use.
Thank you very much for your help,
Daniel
Hi Daniel,
We are validating the reported scenario and update you with further details within two business days.
Regards,
Swetha
Thank you very much Swetha.
- Daniel
Hi Daniel,
Thanks for being patience. We suggest you to use zoomComplete event to change the chart series datasource after zooming. We have prepared sample based on your requirement. Please check with the below snippet and sample.
|
var chart = new ej.charts.Chart({ zoomComplete(args){ chart.series[0].dataSource = getData(20); } }); |
Before Data Update
After Data Update
Sample : https://stackblitz.com/edit/stwep5
Kindly revert us if you have any concerns.
Regards,
Durga Gopalakrishnan.
Hi Durga,
apologies for the long reply cycle.
I tested your suggested solution and it works.
Thank you very much!
Daniel
Hi Daniel,
Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you.
Regards,
Durga Gopalakrishnan.