1、问题
在使用echarts的面积图过程中,会遇见需要自定义最大值、最小值显示的问题。
2、代码
series: [
{
name: '',
type: 'line',
symbol: 'none',
sampling: 'lttb',
itemStyle: {
color: 'rgb(255,156,70)'
},
markPoint: {
data: [
{ xAxis: maxTempPosition, yAxis: maxTemp, value: maxTemp },
{ xAxis: minTempPosition, yAxis: minTemp, value: minTemp },
// {
// type: 'max',
// name: '最大值'
// },
// {
// type: 'min',
// name: '最小值'
// }
]
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(255,208,171)'
},
{
offset: 1,
color: 'rgb(250,249,249)'
}
])
},
data: temp
}
]