Skip to content
Jonathan Simmonds edited this page Sep 24, 2020 · 6 revisions

Fields

JSON is used to set the data displayed on the graph.

names (array or hash) - names of the datasets

When using an array, list the names of the Y datasets followed by the names of the U datasets:

"names": ["Svalbard", "Faro", "Fort William"]

When using a hash, specify the names separately:

"names": {"y: ["Svalbard", "Faro"], "u": ["Fort William"]}

x (array) - x values

If you're satisfied with displaying the same data on the axis (independent of the interval) and information labels then X values can be strings. However, if you're intending to supply axis or information formatters then they need to be integers.

y (array) - array of arrays, each array contains all of the y values for a dataset

u (array) - array of arrays, each array contains all of the u values for a dataset

Example

{
    "names": ["Svalbard", "Faro", "Fort William"],
    "x":["Mon", "Tue", "Wed", "Thu"],
    "y":[[23, 26, 25, 26], [13, 14, 20, 18]],
    "u":[[1, 2, 2, 3]]
}
Clone this wiki locally