user6644024
user6644024

Reputation:

How can I remove particular tools in TradingView widget JS?

The current TradingView widget loaded very slowly in the website. Except that it has a lot of unnecessary functions for users, which I need to remove from the widget.

How can I remove this tools from tradingview widget? The code is below:

new TradingView.widget({
    symbol: 'Bitfinex:ETHUSD',
    interval: '5',
    theme: 'Dark',
    style: '1',
    container_id: "tv_chart_container",
    library_path: "/charting_library/",
    locale: lang,
    width: '100%',
    height: '618px',
    hide_top_toolbar: false,
    left_toolbar: true,
    hide_side_toolbar: false,
    allow_symbol_change: false,
    hideideas: false,
    debug: false,
    chartsStorageUrl: 'https://saveload.tradingview.com',
    chartsStorageApiVersion: '1.1',
    clientId: 'tradingview.com',
    userId: 'public_user_id',
    disabled_features: [
        'use_localstorage_for_settings',
    ],
    preset: 'mobile',
    'studies': [
        'Volume@tv-basicstudies'
    ]
})

enter image description here

Upvotes: 4

Views: 8750

Answers (6)

Munny Kumar
Munny Kumar

Reputation: 91

enabled_features: [
    "hide_left_toolbar_by_default"
]

Upvotes: 9

Ajanyan Pradeep
Ajanyan Pradeep

Reputation: 1132

As per their documentation you can use the property enabled_features.

The value of the property will be the array containing names of features that should be enabled by default.

So in this case the it will be

enabled_features: ["hide_left_toolbar_by_default"]

For more information you can refer hide_left_toolbar_by_default (Reference) visibility control in Visibility of controls and visual elements

You can also disable this by using the property disabled_features (Documentation) by

disabled_features: ["left_toolbar"]

Upvotes: 0

ED Folmi
ED Folmi

Reputation: 1

The feature is now available, just use.

"hide_side_toolbar": true,

Upvotes: 0

Prince
Prince

Reputation: 20882

As per the TradingView docs, you need to provide this value to the widgetOptions:

disabled_features: ['left_toolbar'],

Upvotes: 2

user6644024
user6644024

Reputation:

After a lot of researches and conversation with TradingView support team I has been notified that ITS NOT POSSIBLE yet :)

Upvotes: 0

Nick Friskel
Nick Friskel

Reputation: 2437

To hide certain drawing tools in the left toolbar you would include a drawings_access object in your widget constructor.

https://github.com/tradingview/charting_library/wiki/Widget-Constructor#drawings_access

(link will only be available if you have access to the Trading View Charting Library repo)

Example of removing the Brush and Rectangle tools:

// inside widget constructor
drawings_access: {
    type: "black",
    tools: [
        {
            name: "Brush"
        },
        {
            name: "Rectangle"
        },
    ]
}

Upvotes: 1

Related Questions