echarts 折线图配置

html内容:
<div id="user_num_chart" style="width: 582px;height:250px;"></div>
 
 
<script>
var myChart = echarts.init(document.getElementById('user_num_chart'));
option = {
title: [
{
text: '平台用户总数',
textStyle: {
color: "rgb(253,159,45)",//图标颜色
fontSize:14,
},
right:10,
top: 55,
//subtext: '纯属虚构'
},{
text: '已租房用户',
textStyle: {
fontSize:14,
color: "rgb(42,168,252)"
},
right: 25,
top: 95
}],
xAxis: {
type: 'category',
data: [5.1, 5.8, 5.15, 5.22, 5.29]
},
yAxis: {
type: 'value'
},
// legend: {
// data: [{
// name: '平台用户总数',
// textStyle: { color: "rgb(253,159,45)" },//标题文字颜色
// },{
// name: '已租房用户',
// textStyle: { color: "rgb(42,168,252)" },
// }],
// },
series: [{
name: "平台用户总数",
data: [0, 120, 262, 301, 534, 560],
type: 'line',
smooth: true,
symbol: "none", //去小点
color: "rgb(253,159,45)", //标题图标颜色
lineStyle: { color: "rgb(253,159,45)" },//线条颜色
//label : { normal:{show: true}},
 
}, {
name: "已租房用户",
data: [0, 50, 222, 290, 360, 390, 510],
type: 'line',
smooth: true,
symbol: "none",
color: "rgb(42,168,252)",
lineStyle: { color: "rgb(42,168,252)" },
// itemStyle : { normal: {label : {show: true}}},
}]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>

猜你喜欢

转载自www.cnblogs.com/lan-cheng/p/9215371.html