【问题标题】:Negative color with area color fill and yAxis带区域颜色填充和 yAxis 的负颜色
【发布时间】:2018-04-11 14:54:43
【问题描述】:

基图:

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/
解决方法是使用样条线或直线:

系列: [{ 类型:'样条', 名称:'图表', 数据:[[1523195126000,1],[1523195426000,3],[1523195726000,1],[1523196026000,2],[1523196326000,6],[1523196626000,5],[1523,096926000,6],[1523,0969219022]26,096926000,6, ,[1523197526000,1]], 负颜色:真, 颜色:'#FF4040', 阴影:真实 }]

https://jsfiddle.net/q3x9psdz/23/
但在 cros 上没有区域颜色:

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

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

有颜色填充区域而不扩展 yAxis 的任何解决方案吗?

【问题讨论】:

    标签: javascript highcharts


    【解决方案1】:

    series.softThreshold 设置为true

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-13
      • 2021-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-08
      • 1970-01-01
      • 2021-06-23
      相关资源
      最近更新 更多