Last active
March 29, 2018 21:53
-
-
Save ronokdev/ee9ab8e4a9d0b3a4c108ef84e2ff3534 to your computer and use it in GitHub Desktop.
Amchart integration With Vue-Js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::: Create A project with vue clI | |
::: Download Amchart JS file's from this URL | |
→ https://www.amcharts.com/download/ | |
::: Extract in | |
→ vueProjectName/static/ | |
::: Include All Js Files in the vueProjectName/index.HTML file | |
// **Path | |
→ <script src="../static/amcharts/amcharts.js"></script> | |
→ <script src="../static/amcharts/pie.js"></script> | |
→ <script src="../static/amcharts/plugins/export/export.min.js"></script> | |
→ <link rel="stylesheet" href="../static/amcharts/plugins/export/export.css" type="text/css" media="all" /> | |
→ <script src="../static/amcharts/themes/light.js"></script> | |
→ <script src="../static/amcharts/plugins/dataloader/dataloader.min.js" type="text/javascript"></script> | |
::: Reference URL for Piechart (DEMO) | |
→ http://jsfiddle.net/api/post/library/pure/ | |
::: Use 'Dataloader' instead of 'dataProvider' to Load Via Ajax | |
→ | |
"dataLoader": { | |
"url": "http://localhost:port/ApiUrl", | |
"format": "json", | |
"init": function ( options, chart ) { | |
console.log( 'Loading started' ); | |
}, | |
"load": function ( options, chart ) { | |
console.log( 'Loaded file: ' + options.url ); | |
}, | |
"complete": function ( chart ) { | |
console.log( 'Woohoo! Finished loading' ); | |
}, | |
"error": function ( options, chart ) { | |
console.log( 'Ummm something went wrong loading this file: ' + options.url ); | |
}, | |
"progress": function( totalPercent, filePercent, url ) { | |
console.log( 'Total percent loaded: ' + Math.round( totalPercent ) ); | |
} | |
}, | |
"valueField": "population", | |
"titleField": "name", | |
"startEffect": "elastic", // easeOutSine, easeInSine, elastic, bounce | |
"startDuration": 2, | |
"labelRadius": 15, | |
::: URL JSON format → | |
[ | |
{ | |
name: "Bangladesh", | |
population: 1500 | |
}, | |
{ | |
name: "India", | |
population: 9547 | |
}, | |
{ | |
name: "Nepal", | |
population: 841 | |
}, | |
{ | |
name: "Vutan", | |
population: 665 | |
} | |
] | |
::: Must Include tha CSS Style | |
→ Check Demo CSS style from that LINK → http://jsfiddle.net/api/post/library/pure/ | |
::: Change 'Loading data...' TO Something else | |
→ URL : VueProjectName\static\amcharts\plugins\dataloader\dataloader.min.js | |
→ Search For → Loading data... | |
→ Replace With AnyThing. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment