charting-library-tutorial
charting-library-tutorial copied to clipboard
chart background issue
Hi..
widgetOptions = { ... , // other properties
overrides: {
"paneProperties.background": "#FFFFFF",
"paneProperties.backgroundType": "solid",
}
}
I used this option but chart background is not changed. it's using default gradient background Other properties work fine.
In fact, the custom background color is reflected only on the first load, and default gradient background color is used from subsequent loads (even for only chart reload).
Can you help me on it? Thanks
@dev060 did you find any solution to this?
The solution for me (thanks to Claude) was to apply the overrides after creating the widget and with a delay:
const widget = new TradingView.widget({ ... });
setTimeout(() => {
widget.applyOverrides({
"paneProperties.backgroundType": "solid",
"paneProperties.background": "#ffffff",
});
}, 100);
Hope this helps.