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

chart background issue

Open dev060 opened this issue 2 years ago • 2 comments

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 avatar Jul 01 '23 17:07 dev060

@dev060 did you find any solution to this?

kiran-bhalerao avatar May 31 '25 03:05 kiran-bhalerao

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.

honeybadger26 avatar Aug 01 '25 05:08 honeybadger26