VisActor / VChart

VChart, more than just a cross-platform charting library, but also an expressive data storyteller.
https://www.visactor.io/vchart
MIT License
776 stars 45 forks source link

[Bug] taro按需引入时报错TypeError: Cannot read property 'transformSpec' of null #2720

Closed HongxuanG closed 1 month ago

HongxuanG commented 1 month ago

Version

1.11.0

Link to Minimal Reproduction

1

Steps to Reproduce

image

image image image

Current Behavior

根据文档操作后报错

Expected Behavior

不报错,词云显示出来

Environment

- OS:window 11 
- Browser:小程序
- Framework:Taro 3.6.17

Any additional comments?

No response

HongxuanG commented 1 month ago

image

xile611 commented 1 month ago

@HongxuanG 参考这个文档: https://visactor.com/vchart/guide/tutorial_docs/Load_on_Demand 需要注册一下图表

HongxuanG commented 1 month ago

@HongxuanG 参考这个文档: https://visactor.com/vchart/guide/tutorial_docs/Load_on_Demand 需要注册一下图表

已经参考了,就是这么写的 image

xiaoluoHe commented 1 month ago

@HongxuanG 代码里注册的是系列,你注册一下图表: image 注册系列通常用于组合图中按需使用: image

HongxuanG commented 1 month ago

@HongxuanG 代码里注册的是系列,你注册一下图表: image 注册系列通常用于组合图中按需使用: image

我用到的并非组合图,而是单单一个词云图

xiaoluoHe commented 1 month ago

@HongxuanG 是的,所以不要注册系列,直接注册图表就可以。

VChart.useRegisters([
  registerWordCloudChart, // 词云
  registerWordCloudShapeChart // 形状词云
])
HongxuanG commented 1 month ago

@HongxuanG 是的,所以不要注册系列,直接注册图表就可以。

VChart.useRegisters([
  registerWordCloudChart, // 词云
  registerWordCloudShapeChart // 形状词云
])

🤣感谢感谢,文档好像没相关的描述,我自己看源码看到有这个registerWordCloudChart方法就试了一下,成功了