.dataset Property

Getter/Setter for the dataset. Allows the developer to make changes to the dataset, most usefully the .query hash.

Getter Syntax

var ds = chart.dataset;

Setter Syntax

chart.dataset = myDatasetObject;

Example Code

<div id='chartDiv'></div>

var chart = new Cedar({'specification': 'https://example.org/url_to_specification.json'})

//create dataset object
var dataset = {
      "group": {"field":"District","label":"District"},
      "count": {"field":"Number_of","label":"Student Number_of"}

//assign to chart
chart.dataset = dataset;

//create and render a chart
  'elementId': '#chartDiv'


Edit this page on GitHub