vue-fusioncharts
A simple and lightweight VueJS component for FusionCharts JavaScript Charting Library. The Vue-FusionCharts wrapper lets you easily include FusionCharts in your VueJS projects.
Getting Started
Requirements
- Node.js, NPM/Yarn installed globally in your OS.
- FusionCharts and Vue installed in your project, as detailed below:
Installation
Direct Download
All binaries are located on our github repository.
Install from NPM
Install from Yarn
Include in your script
Download vue-fusioncharts.js
and include it in the HTML <script>
tag.
Usage
There are two ways of adding vue-fusioncharts
component in your project
Registering globally as a plugin
Import vue
, vue-fusioncharts
and FusionCharts in main app file.
Now, register it as plugin in Vue object
This way is recommended when you want component (vue-fusioncharts
) available from everywhere in your app.
Registering locally in your component
Import the chart component from vue-fusioncharts/component
package in your component file and use Vue.component
to register it locally.
This way is recommended when you want component (vue-fusioncharts
) only in specific components of your app.
Click here to view the live example.
Where eventName
can be any fusioncharts event. You can find the list of events at fusioncharts devcenter
Working with APIs
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
Now, we can access the chart object from this.$refs.fc.chartObj
This example will slice a Pie2d section when you rollover the chart.
Working with Events
To attach event listeners to FusionCharts, you can use the v-on
or @
operator in the vue-fusioncharts component.
Quick Start
Here is a basic sample that shows how to create a chart using vue-fusioncharts
:
Here's HTML template for the above example:
links to help you get started:
- Live Samples with code
- Documentation
- Use Chart API events & methods in Vue
- Chart gallery
- FusionCharts API
Usage and integration of FusionTime
From fusioncharts@3.13.3-sr.1
and vue-fusioncharts@3.0.0
, You can visualize timeseries data easily with vue.
Learn more about FusionTime here.
Sample code for FusionTime
Here's HTML template for the above example: