1- # Vue-FusionCharts
21
3- > FusionCharts component for Vue
2+ #### [ Demos and Documentation] ( https://fusioncharts.github.io/vue-fusioncharts/ )
3+
4+ # Vue-FusionCharts
45
5- The Vue-FusionCharts component lets you easily include FusionCharts in your Vue.js projects.
6+ A simple and lightweight ` VueJS ` component for ` FusionCharts ` JavaScript Charting Library. The ` Vue-FusionCharts ` wrapper lets you easily include FusionCharts in your ` VueJS ` projects.
67
78## Installation
89
@@ -18,17 +19,17 @@ npm install vue-fusioncharts --save
1819yarn add vue-fusioncharts
1920```
2021
21- ### manual
22+ ### VanillaJS
2223
23- Download [ ` vue-fusioncharts.js ` ] ( https://github .com/fusioncharts/vue-fusioncharts/blob/feature/plugin-development /dist/vue-fusioncharts.js ) and include it in the HTML ` <script> ` tag.
24+ Download [ ` vue-fusioncharts.js ` ] ( https://rawgit .com/fusioncharts/vue-fusioncharts/master /dist/vue-fusioncharts.js ) and include it in the HTML ` <script> ` tag.
2425
2526``` html
26- <script src =' path/to/vue-fusioncharts/dist/ vue-fusioncharts.js' type =' text/javascript' ></script >
27+ <script src =' vue-fusioncharts.js' type =' text/javascript' ></script >
2728```
2829
29- ## Usage
30+ ## Getting Started
3031
31- ### ES6 Modules (Recommended)
32+ ### ES6 Module
3233
3334``` js
3435import Vue from ' vue' ;
@@ -39,22 +40,21 @@ import FusionCharts from 'fusioncharts'
3940import Charts from ' fusioncharts/fusioncharts.charts'
4041
4142// resolve charts dependency
42- Chart (FusionCharts);
43+ Charts (FusionCharts);
4344
4445// register VueFusionCharts component
4546Vue .use (VueFusionCharts, FusionCharts);
4647```
4748
48- ### CommonJS Modules
49+ ### CommonJS
4950
5051``` js
51- var Vue = require (' vue' );
52-
53- var VueFusionCharts = require (' vue-fusioncharts' );
52+ const Vue = require (' vue' );
53+ const VueFusionCharts = require (' vue-fusioncharts' );
5454
5555// import FusionCharts modules and resolve dependency
56- var FusionCharts = require (' fusioncharts' );
57- var Charts = require (' fusioncharts/fusioncharts.charts' );
56+ const FusionCharts = require (' fusioncharts' );
57+ const Charts = require (' fusioncharts/fusioncharts.charts' );
5858
5959// resolve charts dependency
6060Charts (FusionCharts);
@@ -63,7 +63,6 @@ Charts(FusionCharts);
6363Vue .use (VueFusionCharts, FusionCharts);
6464```
6565
66-
6766### AMD
6867
6968``` js
@@ -83,9 +82,9 @@ require(['vue', 'vue-fusioncharts', 'fusioncharts', 'charts'], function (Vue, Vu
8382});
8483```
8584
86- ### Standalone / CDN
87- If you are not using any bundler, you can refer the file in a script tag. The library will be available in a global object named ` VueFusionCharts ` .
85+ ### VanillaJS
8886
87+ If you are not using any bundler, you can refer the file in a script tag. The library will be available in a global object named ` VueFusionCharts ` .
8988
9089``` html
9190<head >
@@ -96,77 +95,78 @@ If you are not using any bundler, you can refer the file in a script tag. The li
9695</head >
9796
9897<body >
99- <div id =' chart' >
100- <fusioncharts :options =" pieChartConfig" ></fusioncharts >
101- <p class =" message-box" >The value that you have selected is: {{displayValue}} </p >
98+
99+ <div id =" app" >
100+ <fusioncharts
101+ :type =" type"
102+ :width =" width"
103+ :height =" height"
104+ :dataFormat =" dataFormat"
105+ :dataSource =" dataSource"
106+ :events =" events" >
107+ </fusioncharts >
108+ <p >Display Value: {{displayValue}}</p >
102109 </div >
103110
104- <style >
105- .message-box {
106- text-align : center ;
107- margin-top : 0px ;
108- background-color : #F5FBFF ;
109- width : 500px ;
110- color : #006BB8 ;
111- padding : 5px 10px ;
112- box-sizing : border-box ;
113- border : 1px solid #B8E1FF ;
114- }
115- </style >
116-
117111 <script >
118- // Use VueFusionCharts component by calling the Vue.use() global method:
112+ // Use VueFusionCharts component by calling the Vue.use() method:
119113 Vue .use (VueFusionCharts);
120114
115+ const myDataSource = {
116+ chart: {
117+ caption: ' Vue FusionCharts Sample' ,
118+ theme: ' fint'
119+ }
120+ data: [{value: 1.9 }, {value: 2.3 }, {value: 2.1 }]
121+ }
121122 // bootstrap the demo
122- var chart = new Vue ({
123+ var app = new Vue ({
123124 el: ' #chart' ,
124125 data: {
125- pieChartConfig: {
126126 type: ' Pie2D' ,
127127 width: ' 500' ,
128128 height: ' 300' ,
129129 dataFormat: ' json' ,
130- dataSource: {
131- chart: {
132- caption: ' Vue FusionCharts Sample' ,
133- theme: ' fint'
134- },
135- data: [{value: 1.9 }, {value: 2.3 }, {value: 2.1 }]
136- },
137- displayValue: ' nothing' ,
130+ dataSource: myDataSource,
138131 events: {
139132 dataplotRollover : function (ev , props ) {
140- chart .displayValue = props .displayValue
133+ app .displayValue = props .displayValue
141134 }
142- }
143- },
144- displayValue : ' nothing '
135+ },
136+ displayValue : ' '
137+ }
145138 }
146139 });
147140 </script >
148141</body >
149142```
150143Click [ here] ( https://jsfiddle.net/rohitcoolblog/5Lt720a9/ ) to view the live example.
151144
152- ## Register ` vue-fusioncharts ` component
153- ### Use the ` Vue.use ` global method to register the component globally
145+ ## Register ` vue-fusioncharts ` Component
146+
147+ ### Register Globally
148+
149+ Use the ` Vue.use ` method to register the component globally.
150+
154151``` js
155152Vue .use (VueFusionCharts, FusionCharts, Charts);
156153```
157- ### Use the ` Vue.component ` method to register the component locally
154+
155+ ### Register Locally
156+
157+ Use the ` Vue.component ` method to register the component locally.
158+
158159``` js
159160// es6 style
160- import {FCComponent } from ' vue-fusioncharts'
161+ import { FCComponent } from ' vue-fusioncharts'
161162
162163// CommpnJS
163- var FCComponent = require (' vue-fusioncharts' ).FCComponent ;
164+ const FCComponent = require (' vue-fusioncharts' ).FCComponent ;
164165
165166Vue .component (' fusioncharts' , FCComponent);
166-
167167```
168168
169- ### props
169+ ### Component Props
170170
171171* ` options `
172172
@@ -221,11 +221,10 @@ Vue.component('fusioncharts', FCComponent);
221221 </tbody>
222222 </table >
223223
224+ ## Contributing
224225
225-
226- ## Development
227226* Clone the repository.
228- * Install dependency.
227+ * Install dependencies
229228* Run ` npm start ` to start the dev server.
230229* Open ` http://localhost:8080/ ` in your browser.
231230
@@ -236,3 +235,4 @@ $ npm install
236235$ npm start
237236```
238237
238+ ### [ Demos and Documentation] ( https://fusioncharts.github.io/vue-fusioncharts/ )
0 commit comments