Skip to content
g0e edited this page Mar 15, 2014 · 3 revisions

ccd3.Chart

constructor

var chart_instance = new ccd3.Chart(div_id, dataset)
  • create chart instance.
  • div_id must indicate existing id-attribute of div.
  • see also [Dataset Format](Dataset Format).

instance methods

chart_instance.render()
  • render chart.
chart_instance.set_dataset(dataset)
  • another way to setup or update dataset after instance creation.
chart_instance.setup_options(options)
chart_instance.destroy()
  • delete svg and div elements created by chart.

Option setup patterns

  • following pattern1 & pattern2 make same results.
var chart = new ccd3.Chart("chart1",dataset);

// Pattern1
var options = {
	height: 360,
	width: 360,
	title: { text: "Title Test" }
};
chart.setup_options(options);

// Pattern2
chart.height = 360;
chart.width = 360;
chart.title.text = "Title Test";

Clone this wiki locally