【问题标题】:How to display the specific points of the series in styled splines chart?如何在样式样条图中显示系列的特定点?
【发布时间】:2020-01-21 13:33:08
【问题描述】:

我正在使用 LightningchartJS,如果我将鼠标悬停在系列上,它会显示与系列上该点相关联的坐标,但我想在悬停时仅显示系列上的特定点。我该如何实现?

const series = chart.addSplineSeries({ pointShape: PointShape.Circle }) 
.setName('Power consumption') 
.setStrokeStyle((strokeStyle) => strokeStyle 
                .setThickness(4) 
                .setFillStyle(new SolidFill({ color: ColorHEX('#FFA500') })) 
               ) 
.setPointSize(8) 
.setResultTableFormatter((tableBuilder, series, x, y) => tableBuilder 
                         .addRow(series.getName()) 
                         .addRow(series.axisX.formatValue(x)) 
                         .addRow(series.axisY.formatValue(y) + ' kW') 
                        ) 
```                    

【问题讨论】:

    标签: javascript charts series spline lightningchart


    【解决方案1】:

    默认情况下,我们沿系列插入光标值,当鼠标悬停在系列附近时,它会显示光标跟随系列。

    您可以将光标设置为仅指向您提供给系列的数据点,将setting the series' cursor interpolation 设置为 false。

    series.setCursorInterpolationEnabled(false)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-08
      • 2020-10-07
      • 1970-01-01
      • 1970-01-01
      • 2017-03-25
      • 1970-01-01
      • 1970-01-01
      • 2011-02-23
      相关资源
      最近更新 更多