Platform
Resources
Pricing
Sign in
Get started
Dr Aung Min Oo's Workspace
Workspace
Fork
Public
By
Dr Aung Min Oo
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
c3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
css
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
pieChart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML