reactjs - 获取 e.timeScale(...).unsubscribeVisibleTimeRangeChange 不是函数
问题描述
我正在使用kaktana-react-lightweight-charts,一切正常,直到我得到e.timeScale(...).unsubscribeVisibleTimeRangeChange 不是函数错误,因为我没有在我的代码中实现它。我不知道我为什么需要这个?.. 场景是,起初我的图表会按照我的意愿很好地显示,然后当我点击其他数据时,它应该显示具有相同图表的新数据,但我得到了这个错误。所以我想我会实现unsubscribeVisibleTimeRangeChange功能,但不知道如何..
<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?...)
/>
这是我的选择
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,
},
},
解决方案
推荐阅读
- speech-recognition - MS Speech Platform 11 识别器是否支持 ARPA 编译语法?
- javascript - How to save every element in foreach and not just last element?
- android - How to specify API Key in this sample code?
- postgresql - Create Postgres Pivot like excel
- windows - Pyro4 configuration doesn't change
- c# - 反序列化 HTTP 响应 - 获取空值
- mysql - Mysql:通过两个日期获取最新行
- ios - iPhone 上的两个 Ionic 应用程序似乎相互打开
- mysql - MYSQL查询与选择具有不同的限制条件
- r - 相同的种子,PL/R 与 R,不同的结果(随机森林)