1

在 LightningchartJS 仪表中,如何更改仪表边框的颜色?

const gauge = lightningChart().Gauge({ type: GaugeChartTypes.Solid })
.setTitle('Annual sales goal')
.setThickness(80)
.setDataLabelFormater(new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }))
.setGaugeStrokeStyle(new SolidLine().setFillStyle(new SolidFill()).setThickness(1))
.setAngleInterval(225, -45)

// Create slice
const slice = gauge
.getDefaultSlice()
.setInterval(0, 400000)
.setValue(329000)
.setFillStyle(new SolidFill({ color: ColorRGBA(12, 213, 87) }))
.setName('2019 sales')

4

1 回答 1

1

在第 5 行,您正在设置仪表笔划的样式(我猜您称之为“边框”)。
这就是您可以将颜色选项传递给SolidFill构造函数的地方:

.setGaugeStrokeStyle(
  new SolidLine()
    .setFillStyle(
      new SolidFill( {
        color: ColorHEX('#00F')
      } )
    ).setThickness(1)
)

但是您也需要导入 ColorXXX 组件。

于 2019-11-21T08:05:14.047 回答