console
var myChart = echarts.init(document.getElementById('charts1'));
// 指定图表的配置项和数据
var wcrws1 = [
[534, 150, '豆包兔'],
{
value: [515, 148, '父母世界'],
itemStyle: {
normal: {
color: '#b83249',
label: {
show: true,
position: 'top',
formatter: function(params) {
return params.value[2]
}
}
}
}
},
[490, 139, '生活好物攻略'],
[488, 99, '喵喵购'],
[530, 91, '逗玩'],
[522, 88, '爸妈堂育儿'],
[526, 83, '暴走的买买兔'],
[506, 69, '妈咪宝宝小助手'],
[304, 66, '辣妈潮宝汇'],
[456, 65, '陪你一起'],
[461, 64, '拜托了妈妈'],
[428, 51, '糖醋雁子'],
[324, 49, '棒妈经验谈'],
[261, 45, '贝爱妈咪'],
[476, 40, '点点的美好生活'],
[480, 38, '宝妈说'],
[371, 37, '家有三宝达人'],
[435, 35, '冯尼美']
];
var option = {
title: {
text: ''
},
grid: {
x: '7%',
y: '15%',
width: '68%',
height: '88%'
},
yAxis: {
name: '任务完成数',
nameTextStyle: {
fontWeight: 'bold',
fontSize: 15
},
nameGap:23,
type: 'value',
scale: true,
offset: -260,
axisLabel: {
formatter: '{value} '
},
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: '#3259B8'
}
}
},
xAxis: {
name: '综合能力',
nameTextStyle: {
fontWeight: 'bold',
fontSize: 15
},
type:'value',
scale: true,
min: 200,
max: 580,
offset: -180,
axisLabel: {
show: true,
inside: true
},
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: '#3259B8'
}
}
},
series: [{
type: 'scatter',
data: wcrws1,
symbolSize: 11,
itemStyle: {normal:{
color: '#192c5c',
// label: {
// show: true,
// position: 'top',
// formatter: function(params) {
// return params.value[2]
// }}
}
},
markLine: {
show: true,
itemStyle: {
normal: {
color: '#59b832',
lineStyle: {
color: '#59b832',
type: 'solid'
}
}
},
data: [{
type: 'average',
name: '平均值',
valueIndex: 0
},
{
type: 'average',
name: '平均值',
valueIndex: 1
}
]
}
},
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
<script src="https://cdn.bootcss.com/echarts/3.5.4/echarts.js"></script>
<div id="charts1" style="width:600px;height:400px;margin-top:10px;"></div>