Public
Edited
Oct 8, 2023
1 fork
1 star
Insert cell
Insert cell
workbook = FileAttachment("demografia.xlsx").xlsx()
Insert cell
workbook.sheetNames
Insert cell
Insert cell
data = workbook.sheet(0, {
headers: true,
// range: "A1:J10"
})
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Plot.plot({
width:800,
height:3500,
marks: [
Plot.barX(data.filter((d)=> d["CountryName"] != "World"), {y: "CountryNameRu", x: "2015", fill:"Green", sort: {y: "x", reverse: false}}),
Plot.ruleX([], {fill:"Green"})],
color: { legend: true },
marginLeft: 200,
})
Insert cell
Insert cell
Plot.plot({
width:1350,
height:600,
grid: true,
x: {label: "Год"},
y: {label: "Население"},
marks: [
Plot.ruleY([0]),
Plot.lineY(data, {x: data.columns.slice(2,58).reverse(), y: Object.values(data[53]) , stroke: "#e15759"})
]
})

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