效果图 :
代码:
var CarckLongOption = {
title: {
left: 'center',
text: '裂缝半长延伸图',
textStyle: {
fontSize: 13
}
},
grid: {
top: '25px',
bottom: '20px',
left: '20px',
right: '10px',
containLabel: true
},
tooltip: {
trigger: 'axis',
//axisPointer: {
// axis: 'y'
//},
//formatter: function (data) {
// var params = data[0];
// return "井深:" + params.value[1].toFixed(1) + "米<br>井筒温度:" + params.value[0].toFixed(1) + "℃";
//}
},
xAxis: {
type: 'value',
name: '裂缝半长(m)',
nameGap: '25',
nameLocation: 'center',
//data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'category',
name: '缝高(m)',
nameGap: '30',
nameLocation: 'center',
position: 'top',
},
series: [
{
data: [[150, 0], [180, 10], [200, 20], [218, 30], [200, 40], [180, 50], [150, 60]],
type: 'line',
showSymbol: false,
areaStyle: {},
smooth: true
},
{
data: [[130, 0], [160, 10], [180, 20], [198, 30], [180, 40], [160, 50], [130, 60]],
type: 'line',
showSymbol: false,
areaStyle: {},
smooth: true
},
{
data: [[110, 0], [140, 10], [160, 20], [178, 30], [160, 40], [140, 50], [110, 60]],
type: 'line',
showSymbol: false,
areaStyle: {},
smooth: true
}
]
};
CarckLongChart = echarts.init(document.getElementById('CarckLongChart'), { renderer: 'svg' });
CarckLongChart.setOption(CarckLongOption);
重点就在x轴和y轴的type上。 series里面的areaStyle可根据需求自行设置。