@visactor/lark-vchart 1.1.0-beta.1 → 1.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/index.js +2 -2
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -48,6 +48,8 @@ interface IEvent {
|
|
|
48
48
|
|
|
49
49
|
## 如何使用
|
|
50
50
|
|
|
51
|
+
除了阅读下面的使用说明,也可以直接移步 [lark-vchart-example](https://github.com/VisActor/lark-vchart-example)。
|
|
52
|
+
|
|
51
53
|
### 前提
|
|
52
54
|
|
|
53
55
|
在使用 VChart 飞书小程序组件库前,请确保你已经了解过飞书开放平台的相关文档介绍。
|
|
@@ -148,14 +150,14 @@ Page({
|
|
|
148
150
|
|
|
149
151
|
1. 飞书小程序现阶段由于序列化问题,还不支持在 setData 以及 triggerEvent 中传递复杂对象及函数,只支持可序列号的数据。**因此 `events` 功能, `chartinit` 回调参数, `chartready` 回调参数暂不可用**
|
|
150
152
|
|
|
151
|
-
针对一些需要使用到 chart 实例的功能,目前可以通过 [selectComponent](https://open.feishu.cn/document/uYjL24iN/uADMx4CMwEjLwATM) ,在给组件 `<chart
|
|
153
|
+
针对一些需要使用到 chart 实例的功能,目前可以通过 [selectComponent](https://open.feishu.cn/document/uYjL24iN/uADMx4CMwEjLwATM) ,在给组件 `<chart id="chart1">` 标明 id 属性后,通过 `selectComponent` 拿到图表实例,如下所示:
|
|
152
154
|
|
|
153
155
|
```javascript
|
|
154
156
|
onChartReady() {
|
|
155
157
|
console.log('chart 实例渲染完成');
|
|
156
158
|
this.selectComponent("#chart1", res => {
|
|
157
|
-
const chartInstance = res && res.
|
|
158
|
-
|
|
159
|
+
const chartInstance = res && res.chart; // 获取 chart 实例
|
|
160
|
+
console.log('获取 VChart 实例', chartInstance);
|
|
159
161
|
});
|
|
160
162
|
},
|
|
161
163
|
```
|