Public
Edited
Dec 26, 2023
Insert cell
Insert cell
d3 = require("https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js")
Insert cell
c3 = require("https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.18/c3.js")
Insert cell
css = {
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = "https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.18/c3.css";
return document.getElementsByTagName("head")[0].appendChild(link);
}
Insert cell
html`<div id="chart"></div>`
Insert cell
pieChart = {
const chart = c3.generate({
bindto: "#chart",
data: {
// iris data from R
columns: [
["data1", 30],
["data2", 120]
],
type: "donut"
},
donut: {
title: "Title",
label: {
fontSize: 10
}
},
size: {
width: 250,
height: 200
}
});
return chart;
}
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