配置项如下
option = {
legend: {
// data:['高度(km)与气温(°C)变化关系']
data:[{
name: "Alert State",
icon: "square",
// icon : 'image://../asset/ico/favicon.png',
// icon: 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z'
//textStyle: {
// color: "#222222",
// fontSize: "13px",
// fontFamily: "Arial"
//}
}]
},
tooltip: {
trigger: 'axis',
formatter: "Temperature : <br/>{b}km : {c}°C"
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value',
axisLabel: {
formatter: '{value} °C'
}
},
yAxis: {
type: 'category',
axisLine: {onZero: false},
axisLabel: {
formatter: '{value} km'
},
boundaryGap: false,
data: ['0', '10', '20', '30', '40', '50', '60', '70', '80']
},
series: [
{
name: '高度(km)与气温(°C)变化关系',
type: 'line',
smooth: true,
lineStyle: {
normal: {
width: 3,
shadowColor: 'rgba(0,0,0,0.4)',
shadowBlur: 10,
shadowOffsetY: 10
}
},
data:[15, -50, -56.5, -46.5, -22.1, -2.5, -27.7, -55.7, -76.5]
},
{
name: "Alert State",
type: 'line',
itemStyle: {
normal: {
color: 'rgba(251,222,222,0.5)'
}
}
}
]
};