From c2022dc02901f1f40657d3e665dfab8b99049a4f Mon Sep 17 00:00:00 2001 From: S-Xiao <35770569+ShmilyXI@users.noreply.github.com> Date: Mon, 11 Nov 2019 10:43:06 +0800 Subject: [PATCH] Update start.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: 新增获取实例的示例代码 --- bizCharts/zh/docs/start.md | 41 +++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/bizCharts/zh/docs/start.md b/bizCharts/zh/docs/start.md index 7a30ab2..8e200e8 100644 --- a/bizCharts/zh/docs/start.md +++ b/bizCharts/zh/docs/start.md @@ -75,8 +75,45 @@ ReactDOM.render(( ![](https://img.alicdn.com/tps/TB1PVaoPFXXXXcSaXXXXXXXXXXX-519-401.png) -## Dependencies +## 其他配置 +### 获取chart实例 +```js +class Line extends React.Component { + render() { + let chartIns; //初始化实例 + ... + return ( +
+ { + //获取 chart 实例的回调。每当生成一个新 chart 时就会调用该函数,并以新生成的 chart 作为回调参数。 + chartIns=chart; + }} + onPlotMove={ev => { + var point = { + x: ev.x, + y: ev.y + }; + // 调用实例上的方法 + var items = chartIns.getTooltipItems(point); + console.log(items); + }} + > + ... + +
+ ); + } +} +ReactDOM.render(, mountNode) + +``` + +## Dependencies ```json { "peerDependencies": { @@ -94,7 +131,5 @@ ReactDOM.render(( ## Browser Support Versions 支持Chrome,Safari,IE11+ 浏览器 - - ## 体验改进计划说明 G2 decided to terminate the "Experience Improvement Program". In verson @antv/g2@3.4.7(released at 2018.12.26) and above, all tracking code is removed, no unexpected remote request will be sent while you are using G2. And Bizcharts Upgrade the dependent version the first time at 2018.12.26 24:00.