Published
Edited
Feb 8, 2019
1 fork
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chart1 = {
var chartinfo = {
showMargins: false, // for visual debugging
height: 562, // this needs to be adjusted manually (for now)
title: "Support or Oppose Right to Privacy at State Level",
sub: "Which of the following best represents your level of support or opposition to this type of constitutional protection in your state?",
footer: 'Survey of 1182 U.S. adults (Dec 2018)',
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))
.style("background-color", globals.color.offwhite);
// let's generate the chart!
chartGen(svg, chartinfo);

return svg.node();
}
Insert cell
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
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