vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 2
声望: 0

点击左侧的CTA回测 app的时候,出现报错 Can't add an axis to multiple plots. Shared axes can be achieved with multiple AxisItem instances and set[X/Y]Link,
麻烦各位大佬帮忙看看这个错有遇到过吗, 版本是2.1.8

完整的错误堆栈:

Traceback (most recent call last):
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/vnpy/trader/ui/mainwindow.py", line 281, in open_widget
widget = widget_class(self.main_engine, self.event_engine)
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/vnpy/app/cta_backtester/ui/widget.py", line 49, in init
self.init_ui()
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/vnpy/app/cta_backtester/ui/widget.py", line 211, in init_ui
self.candle_dialog = CandleChartDialog()
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/vnpy/app/cta_backtester/ui/widget.py", line 1189, in init
self.init_ui()
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/vnpy/app/cta_backtester/ui/widget.py", line 1199, in init_ui
self.chart.add_plot("volume", maximum_height=200)
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/vnpy/chart/widget.py", line 72, in add_plot
plot = pg.PlotItem(axisItems={'bottom': self._x_axis})
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/pyqtgraph/graphicsItems/PlotItem/PlotItem.py", line 159, in init
self.setAxisItems(axisItems)
File "/usr/local/anaconda3/envs/pytrader/lib/python3.7/site-packages/pyqtgraph/graphicsItems/PlotItem/PlotItem.py", line 330, in setAxisItems
"Can't add an axis to multiple plots. Shared axes"
RuntimeError: Can't add an axis to multiple plots. Shared axes can be achieved with multiple AxisItem instances and set[X/Y]Link.

Member
加入于:
帖子: 8
声望: 2

重装 pyqtgraph-0.10.0 用这个版本

Member
avatar
加入于:
帖子: 2
声望: 0

漫步 wrote:

重装 pyqtgraph-0.10.0 用这个版本

感谢大佬,问题解决

Member
avatar
加入于:
帖子: 20
声望: 0

漫步 wrote:

重装 pyqtgraph-0.10.0 用这个版本

我也遇到同類問題。
感謝樓主和漫步 ☀️👍

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号