【问题标题】:Highcharts hide connected line between individual pointsHighcharts隐藏各个点之间的连接线
【发布时间】:2014-10-20 18:52:06
【问题描述】:

我正在使用折线图通过 Highchart 4.0.3 库绘制我的数据。

我想知道是否有任何方法可以删除 2 个单独点之间的连接线或将其颜色设置为透明?

我只能找到为整个系列线设置颜色的选项。

非常感谢您的时间和帮助。

【问题讨论】:

    标签: highcharts


    【解决方案1】:

    我找到了更好的解决方案:lineWidth : 0 为我工作。

    http://api.highcharts.com/highcharts#plotOptions.series.lineWidth

    【讨论】:

      【解决方案2】:

      这真的很老了,但我在 2021 年偶然发现了这个。 我的解决方案/技巧是在您不想要一条线的点之间的系列中添加一个null 值数据集。

      注意:plotOptions.series.connectNulls 默认为false,所以不会画线。 示例系列:

      const series = {
              type: 'line',
              lineWidth: 1,
              color:'#00ff00',
              dashStyle: 'Solid',
              marker: {
                  symbol: 'circle',
                  enabled: true
              },
              name: `my series`,
              data: [
              {
                  y: 10
                  x: Date.now() - 86400000
              },
              
              {
                  y: 10,
                  x: Date.now(),
                  color: 'red'
              },
              {
                  y: null,
                  x: null,
              },
              {
                  y: 7,
                  x: Date.now() - 86400000,
                  color: 'red'
              },
              {
                  y: 7,
                  x: Date.now()
              },
              ]
          }
      

      我刚刚有一个简单的用例 - 在图表上绘制阈值。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-08
        • 2021-03-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-25
        相关资源
        最近更新 更多