步骤:
- 引入js
- 定义dom节点
<div class="daily-count-chart" style="width: 650px;height: 500px"></div>
- 获取dom节点
let myChart = echarts.init(document.querySelector(".chart"))
- 定义配置
option = {
};
- 设置
myChart.setOption(option);
let option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
smooth: true,
color:'blue',
markPoint: {
data: [
{ type: 'max', name: 'Max' },
{ type: 'min', name: 'Min' }
]
},
}
]
};