Kaktana / kaktana-react-lightweight-charts

A simple react wrapper for the tradingview lightweight charts module
MIT License
106 stars 55 forks source link

Getting e.timeScale(...).unsubscribeVisibleTimeRangeChange is not a function error message #30

Closed nisa99 closed 2 years ago

nisa99 commented 2 years ago

HI, I am getting e.timeScale(...).unsubscribeVisibleTimeRangeChange is not a function error, as I did not implement it in my code. I do not know why I need this?.. The scenario was, At first my chart will displayed nicely as I wanted, then when I click at other data, it should display new chart but instead I get this error. So I think I will implement unsubscribeVisibleTimeRangeChange function but dont know how..

This is how the code look like

` <Chart

            lineSeries={this.getChartData1("line", mainData)}
            options={optionMaster}
            autoWidth
            height={indexMode ? 320 : 240}
            onCrosshairMove={(e) => this.createLineChart(e, mainData)}
            onClick={(e) => this.openWindow(e, mainData)} 
            ( ....unsubscriberVisibleTimeRangeChange..how to call from here?...)

          />`

This is my options

optionMaster: { alignLabels: true, localization: { dateFormat: "dd MMM 'yy", }, handleScroll: { mouseWheel: false, pressedMouseMove: false, horzTouchDrag: false, vertTouchDrag: false, }, handleScale: { axisPressedMouseMove: false, mouseWheel: false, pinch: false, }, priceScale: { position: "left", autoScale: true, invertScale: true, alignLabels: false, borderVisible: false, borderColor: "#555ffd", scaleMargins: { top: 0.3, bottom: 0.25, }, }, timeScale: { fixLeftEdge: true, lockVisibleTimeRangeOnResize: true, }, },

nisa99 commented 2 years ago

Really appreciate any helps...

augiaugi commented 2 years ago

same for me, could it correlate with the lightweight-charts version.

"node_modules/kaktana-react-lightweight-charts": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kaktana-react-lightweight-charts/-/kaktana-react-lightweight-charts-2.0.0.tgz", "integrity": "sha512-j2hJLtz18XplhkJHW6K3tqd9f2LStamypttZbfyAgHEFYI6uRCoKzWuKNiTYTM8Eqsr18eynGcYrACIU1C10nw==", "dependencies": { "fast-deep-equal": "^3.1.1", "lightweight-charts": "^3.3.0" }, "peerDependencies": { "react": "^16.13.1" } },

Because in my setup 3.7.0 is installed:

"node_modules/lightweight-charts": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/lightweight-charts/-/lightweight-charts-3.7.0.tgz", "integrity": "sha512-OFPdU4kRtgqHrzi+O86MxBPwbbMsdKRiAQm5nM14/iwN7BJRqWmrdT7uCGnP6+pU8rm3sxjZwMyL8dX0eaQnvQ==", "dependencies": { "fancy-canvas": "0.2.2" } },

SimonDamberg commented 2 years ago

@augiaugi @nisa99 Since this repo seems to be stale, we have created a fork with updated lightweight-charts versions. This seems to have fixed the bugs we were having. Please check it out at https://github.com/Qognica/qognicafinance-react-lightweight-charts

AurelReb commented 2 years ago

@SimonDamberg Thank you very much for maintaining this wrapper. Indeed, I don't have enough time to maintain the repo. I will pin your fork and mark our repo as deprecated if you mind.

SimonDamberg commented 2 years ago

@AurelReb No problem! Go ahead and pin it :)

SimonDamberg commented 2 years ago

@AurelReb Hi! Just a reminder that you never pinned our fork and marked this repo as deprecated. :)

AurelReb commented 2 years ago

@SimonDamberg Hi! sorry for the late reply, I just put your fork in the readme and marked this repo as deprecated. Thank you