JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/npm/echarts@4.7.0/dist/echarts.min.js"></script>
<div id="main"></div>
CSS
#main {
width: 800px;
height: 600px;
}
JavaScript
option = {
xAxis: {
type: 'category',
boundaryGap: false,
data: ['A', 'B', 'C', 'D', 'E', 'F', 'G']
},
yAxis: {
type: 'value'
},
series: [
{
name: 'Series A',
type: 'line',
smooth: true,
data: [120, 132, 101, 134, 90, 230, {
value: 210,
label: {
show: true,
position: 'right',
formatter: 'Series A'
}
}]
},
{
name: 'Series B',
type: 'line',
smooth: true,
data: [220, 182, 191, 234, 290, 330, {
value: 310,
label: {
show: true,
position: 'right',
formatter: 'Series B'
}
}]
},
{
name: 'Series C',
type: 'line',
smooth: true,
data: [150, 232, 201, 154, 190, 330, {
value: 410,
label: {
show: true,
position: 'right',
formatter: 'Series C'
}
}]
}
]
};
const chart = echarts.init(document.getElementById('main'));
chart.setOption(option);