Skip to content

Unable to set custome time frame/range #417

@romain-neil

Description

@romain-neil

Checlist
Note: As the charting library is not public, or hasbeen remove, and has we cant contact TV by email, I post my issue here.

Describe the bug

Hello,
I try to set a custom chart timeframe.
According to the documentation available at https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale/ , I wrote the following code :

const widget = new window.TradingView.widget({
//...
}

widget.onChartReady(() => { const chart = widget.chart(); chart.setTimeFrame({val: {type: 'period-back', value: selectedFilter}, res: selectedFilter})})

The error I got is : TypeError: widget.onChartReady is not a function

Please note that the code is inside a reatc project.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

Image
(picure from the documentation itself)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions