charting-library-examples icon indicating copy to clipboard operation
charting-library-examples copied to clipboard

Save/Load API in TradingView charts saves chart background color unexpectedly

Open money-development opened this issue 1 year ago • 0 comments

Save/Load API in TradingView charts saves chart background color unexpectedly save\load docs

Description When using the save and load API in TradingView charts, I expect all user-created drawings (lines, shapes, etc.) to be saved and restored. However, the chart background color is also saved as part of the state. If a user creates drawings on a light theme and later switches to a dark theme, the chart elements will adapt to the new theme, but the background color remains as it was in the saved state (light). This results in a visually inconsistent chart.

Steps to Reproduce Open the TradingView chart in a light theme Create a drawing on the chart (e.g., a line or shape) Save the chart state using the save API Switch the application to the dark theme Load the saved state using the load API

Expected Behavior The background color should update to match the current theme when the state is loaded

In this example the drawing was made in dark theme, then I switched to light, the background remained dark

image

money-development avatar Jan 11 '25 07:01 money-development