You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,6 +225,43 @@ To attach event listeners to FusionCharts, you can use the `v-on` or `@` operato
225
225
@eventName="eventHandler">
226
226
</fusioncharts>
227
227
```
228
+
Where `eventName` can be any fusioncharts event. You can find the list of events at [fusioncharts devcenter](https://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-events)
229
+
230
+
## Working with APIs
231
+
232
+
To call APIs we will need the chart object. To get the chart object from the component we can use `ref` and retrieve it from `this.$refs[refname].chartObj`
233
+
234
+
```html
235
+
<fusioncharts
236
+
:type="type"
237
+
:width="width"
238
+
:height="height"
239
+
:dataFormat="dataFormat"
240
+
:dataSource="dataSource"
241
+
@dataPlotRollover="onDataPlotRollover"
242
+
ref="fc">
243
+
</fusioncharts>
244
+
```
245
+
Now, we can access the chart object from `this.$refs.fc.chartObj`
246
+
247
+
```js
248
+
var app =newVue({
249
+
el:'#chart',
250
+
data: {
251
+
type:'Pie2D',
252
+
width:'500',
253
+
height:'300',
254
+
dataFormat:'json',
255
+
dataSource: myDataSource,
256
+
},
257
+
methods:{
258
+
onDataPlotRollover:function (e) {
259
+
this.$refs.fc.chartObj.slicePlotItem(0);
260
+
}
261
+
}
262
+
});
263
+
```
264
+
This example will slice a Pie2d section when you rollover the chart.
0 commit comments