1.绘制折线图
let myDom = document.querySelector(dom);//要放的元素
let myChart = echarts.init(myDom, 'light');//使用的主题
let option = {
tooltip: {
trigger: 'axis'
},
legend: {
data: ['人气量', '收藏量', '转发量', '动态量'],
right: 'center',
bottom: 0,
orient: 'horizontal'
},
calculable: true,
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['1天', '2天', '3天', '4天', '5天', '6天', '7天']
}
],
yAxis: [
{
// min: 0,
// max: 70
type: 'value'
}
],
series: [
{
name: '人气量',
type: 'line',//所要选择的图形类型
itemStyle: {
// 点的颜色。
color: '#3995f5'
},