What's the best way to use external XML or JSON to replace chart.js data?

Great that you can add charts with chart.js, but what if I want the charts to be driven by data in an external file?

Alternatively, I would have to swap out the entire chart code or data on the HTML page using the advanced export script feature?

Any ideas on how best to accomplish this? I don't want to have to re-enter all the data using the Bootstrap Studio interface!

In this case I think it would be best to include Chart.js in your project as an external library and script the chart yourself. This way you will have full control over your chart and data. There are lots of examples online on how to pass external xml/json to Chart.js instances, so it will be a matter of copy/pasting some JS and adapting it to work.

1 Like

I would also find that very practical.
I have large amounts of data in xml files that I want to display in charts, and they changing often. Its to much to get it in manually.

A option to select a (xml) file or to import xml code was verry nice!

@bsore

Here is an example of how you can do it

2 Likes