gpt4 book ai didi

javascript - 带有区域颜色填充和 y 轴的负色

转载 作者:行者123 更新时间:2023-11-29 20:55:02 24 4
gpt4 key购买 nike

基本图表:

type: 'area',

https://jsfiddle.net/q3x9psdz/19/
但是当当前图表的交叉值太大时 - yAxis 正在扩展:

  plotOptions: {
series: {
threshold: 20,
}
},
xAxis: {
type: 'datetime',
tickPixelInterval: 50,
crosshair: true,
},
yAxis: {
plotLines: [{
value: 0,
width: 1,
color: '#808080'
},
{
value: 20,
color: 'coral',
dashStyle: 'shortdash',
width: 2,
}
]}

https://jsfiddle.net/q3x9psdz/14/
解决方法是使用样条曲线或直线:

    series: [{            type: 'spline',        name: 'Chart',        data: [[1523195126000,1],[1523195426000,3],[1523195726000,1],[1523196026000,2],[1523196326000,6],[1523196626000,5],[1523196926000,2],[1523197226000,3],[1523197526000,1]],        negativeColor: true,        color: '#FF4040',        shadow: true    }]

https://jsfiddle.net/q3x9psdz/23/
But on cros no area color:

plotOptions: {
series: {
threshold: 2.5,
}
},

https://jsfiddle.net/q3x9psdz/21/

是否有颜色填充区域且不扩展 yAxis 的解决方案?

最佳答案

设置series.softThresholdtrue

plotOptions: {
series: {
threshold: 20,
softThreshold: true
}
},

实例:https://jsfiddle.net/j58bvw36/

关于javascript - 带有区域颜色填充和 y 轴的负色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49778350/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com