option = {
xAxis: { type: 'log' },
yAxis: {
type: 'value',
min: 0,
max: function (value) {
return value.max;
},
axisLabel: {
formatter: '{value} %'
}
},
series: [
{
// name: '紫色',
type: 'line',
data: [
[0.0004, 500],
[0.001, 200],
[0.003, 140],
[0.02, 120],
[0.5, 120],
[0.5, 110],
[10, 110],
[100, 110]
],
itemStyle: {
normal: {
color: '#ad46f3'
}
}
},
{
symbolSize: 20,
data: [[3.03, 4.23]],
type: 'scatter',
itemStyle: {
normal: {
color: '#33f333'
}
}
}
]
};
https://echarts.apache.org/ex...
如果是单纯的判断在任意曲线哪一侧的话,需要一些图形学的知识,因为曲线还有闭合、交叉的情况,不过既然是折线图,那就好办,因为折线图不会闭合、且
x
值是唯一的。假设折线的方程是
f(x)
,点坐标是[x, y]
,那么f(x) > y
就是在B
区,把比较符号反过来就是在A
区,相等则是在折线上。折线函数大致长这样——
_
不确定能不能直接运行。