All our charts support dynamic incremental data loading by either specifying an URL or dataFunction
in the settings.
For example, if you open browser developer tools on this example you will see that initially the chart queries the URL that is given in the settings (though it adds two special parameters: limit
and offset
):
https://cpapi.zoomcharts.com/csdd/api/api.php?request=top&mode=json&sequence=mark-model-year&category=b&limit=50&offset=0
This request returns only the top level data. Once you click on a slice, the chart will dynamically invoke the same URL but with additional parameter id
:
https://cpapi.zoomcharts.com/csdd/api/api.php?request=top&mode=json&sequence=mark-model-year&category=b&id=mark%3DRENAULT&limit=50&offset=0
This ID value is the one that was specified in the top level data for that particular slice. It would more commonly be a numeric value but as you can see, any ID value will work.
You can also use dataFunction
if you need more control on how the Ajax request is formed. The basic principle is the same - each time the chart requires more data, it will invoke the function.