Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
money-development opened this issue Jan 11, 2025 · 0 comments

Comments

@money-development
Copy link

money-development commented Jan 11, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant