Skip to content

Commit a3de4b8

Browse files
authored
Merge pull request #18 from legndery/feature/RED-7973-plugin-revamp-new
Added readme
2 parents 322eccc + 5a1d838 commit a3de4b8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,43 @@ To attach event listeners to FusionCharts, you can use the `v-on` or `@` operato
225225
@eventName="eventHandler">
226226
</fusioncharts>
227227
```
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 = new Vue({
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.
228265

229266
## Contributing
230267

0 commit comments

Comments
 (0)