1

我正在使用 LightningChartJS 创建 OHLC 图表。默认情况下,条形图具有红色和绿色。如何更改这些条形图的颜色?如何添加填充样式

.setPositiveStyle( (figure) => figure
                    .setStrokeStyle( (stroke) => stroke.setThickness(2) )
                   )
  .setNegativeStyle( (figure) => figure
                    .setStrokeStyle( (stroke) => stroke.setThickness(2) )
                   )
4

1 回答 1

0

您可以使用setBodyFillStyle方法更改 OHLC 图的主体。

const series = chart.addOHLCSeries()
// Style a positive OHLC figure
series.setPositiveStyle( (figure) => figure
    // Style the body of a Positive Figure
    .setBodyFillStyle( new SolidFill({ color: ColorHEX('#E69965')})
)
// Style a negative OHLC figure
series.setNegativeStyle( (figure) => figure
    // Style the body of a Negative Figure
    .setBodyFillStyle( new SolidFill({color: ColorHEX('#E659A5')})
)
于 2019-10-28T11:25:06.497 回答