Like the data itself, you may also want to load the chart definition from your server. The “chart” attribute of the chart tag allows to define an URL for loading the chart JSON file. The next example loads the chart configuration from the file bar1.json and the data from the file data1.json and displays both as chart:

<chart data="/charts/data1.json" config="/charts/bar1.json"/>

Shared datasources

Until now, each chart defined its own datasource. As an alternative, you can define one or more central datasources and use them in multiple charts simultaneously.

As central must be created with the <cube> tag. A cube tag contains a data definition as described before and a name defined by the name attribute. This example creates a shared datasource named “cube1” with the data from the upper example: