html部分
<div id="brokenline"></div>
css部分
#brokenline {
position: absolute;
top: 68px;
left: 15px;
width: 1503px;
height: 334px;
}
js部分
<script>
var myChart = echarts.init(document.getElementById('brokenline'));
var option = {
tooltip: {
trigger: 'axis'
},
//图表部分
legend: {
top: 0,
right: 260,
data: [{
name: '已处理告警',
icon: 'line',
textStyle: {
fontSize: 12,
color: '#fc41a8'
},
}, {
name: '全部告警',
icon: 'line',
textStyle: {
fontSize: 12,
color: '#3985e0'