Published
Edited
Dec 1, 2019
Fork of Pie Charts
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chart1 = {
var chartinfo = {
showMargins: false, // for visual debugging
height: 500, // this needs to be adjusted manually (for now)
info: {
type: "pie",
order: "pos-neutral-neg",
legend: "default"
},
data: data1, // remember to use YOUR dataset here

// DO NOT EDIT BELOW THIS LINE
sub_y: 0,
main_y: 0
}

const svg = d3.select(DOM.svg(globals.width, chartinfo.height))
// let's generate the chart!
chartGen(svg, chartinfo);

return svg.node();
}
Insert cell
// md `Tada! To download this, include this function below (remember to rename it to YOUR chartname — in this case, it's \`chart1\`):`
Insert cell
// html`
// ${DOM.download(serialize(chart1), 'chart', 'Download as SVG')}
// ${DOM.download(rasterize(chart1), 'chart', 'Download as PNG')}
// `
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more