Published
Edited
Apr 22, 2020
Fork of Line graph
1 fork
Line graph
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require ('d3')
Insert cell
Insert cell
series= [{
name: "1",
data: s_1
},/* {
name: "Mobiles",
data: generateDayWiseTimeSeries(new Date('1 Jan 2010').getTime(), 20, { min: 0, max: 10 })
}*/]
Insert cell
options = ({
chart: {
type: 'line',
toolbar: {
show: false,
tools: {
download: false,
selection: false,
zoom: false,
zoomin: false,
zoomout: false,
pan: false,
reset: false
}
}
},
dataLabels: {
enabled: false
},
legend: {
show: interactive
},
markers: {
size: 6,
style: 'full',
},
stroke: {
curve: 'smooth'
},
series: series,
xaxis: {
tickAmount:10
//type: 'int'
},
yaxis: {
min: 0,
max: 1,
tickAmount: 10
},
tooltip: {
enabled: interactive,
custom: function({_, seriesIndex, dataPointIndex, w}) {
return `<div class="arrow_box">
<h2>${series[seriesIndex].data[dataPointIndex].title}</h2>
<p>${series[seriesIndex].data[dataPointIndex].comment}</p>
<p>Level: ${series[seriesIndex].data[dataPointIndex].level}</p>
</div>`
}
}
})
Insert cell
Insert cell
chart = new ApexCharts.default(
document.querySelector("#chart"),
options
)
Insert cell
chart.render()
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