根据 y 轴的值更改线条的颜色

时间:2021-04-02 20:27:21

标签: javascript reactjs charts apexcharts recharts

大家好,我在更改基于 y 轴值的图形线的颜色时遇到问题。我想为 Y 轴设置一个限制。例如,如果y轴点的值在最大y轴为100的情况下在40到60之间,我希望线条的颜色为红色,否则为蓝色。

if (y-axis is between 40 to 60) {
  the colour of the line should be red on that points
}
else {
  on other points it should be blue
}

代码笔: https://codesandbox.io/s/recharts-playground-forked-tc0xf?file=/index.js

0 个答案:

没有答案