Closed nakcyber closed 1 year ago
The issue we need to pay attention here is custom colors per bar item (available for histogram atm, but could be implemented in other series soon in #195). If you don't use custom colors - you can do it easily by getting color from options (for bars logic of choosing a color is pretty simple).
How can I get the candle color on mouseover from charts that are like candle type?
any body here?
At the moment, you can't get the colour directly from the API but you can work around this to get it working.
The colour of the candlestick is either based on whether the it is higher or lower than the previous value, or set by the data itself.
The crosshair event (https://tradingview.github.io/lightweight-charts/docs/api/interfaces/IChartApi#subscribecrosshairmove) contains a time
property which you could use to either check the colour you've set in the data, or find the previous value and compare it's value to determine the expect colour.
Hi, lightweight-charts team Is it possible to get
barStyle()
via an index in the series chart in lightweight-charts v3.1.2 ? I used tobarStyle()
for get color in lightweight-charts v2.0.0example Information obtained from the
barStyle()
{ barBorderColor: "rgb(229, 68, 95)" barColor: "rgb(229, 68, 95)" barWickColor: "rgb(229, 68, 95)" }Now it doesn't work. Can I have another method to use instead?
I want to get
barStyle()
method because my app chart has a legend feature a color the same as the bar color.Lightweight Charts Version: 3.1.2