我正在使用LightningChartJS创建OHLC图表。条形图默认为红色和绿色。如何更改这些条形图的颜色? 如何将填充样式添加到
.setPositiveStyle( (figure) => figure
.setStrokeStyle( (stroke) => stroke.setThickness(2) )
)
.setNegativeStyle( (figure) => figure
.setStrokeStyle( (stroke) => stroke.setThickness(2) )
)
答案 0 :(得分: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')})
)