tradingview / lightweight-charts

Performant financial charts built with HTML5 canvas
https://www.tradingview.com/lightweight-charts/
Apache License 2.0
9.13k stars 1.58k forks source link

Series title obfuscates the chart line #1675

Open frontier159 opened 1 month ago

frontier159 commented 1 month ago

Lightweight Charts™ Version: 4.1.6

Steps/code to reproduce:

Set the title of a right series, with fixRightEdge: true

Actual behavior:

The title for the right series is on top of the line at the default scale

Expected behavior:

The title shouldn't overlap the actual line. Alternatively an option to have the title always be on the left hand side even for a right series

Screenshots:

image
SlicedSilver commented 1 month ago

You could try increasing the rightOffset value on the time scale options so that the chart will leave more space on the right edge.

This value is specified in 'number of bars' (data points) and not a normal length like pixels. So the amount of space that you need to leave is dependent on the zoom level (barSpacing). More details in this answer: https://github.com/tradingview/lightweight-charts/issues/1622#issuecomment-2186508182

frontier159 commented 1 month ago

Thanks @SlicedSilver - I think I found the issue. If fixRightEdge: true, then the rightOffset isn't obeyed.

Could this please be confirmed and if so added to the backlog to fix?