├── .gitignore
├── README.md
├── example
├── bundle.js
├── example.html
├── example.js
├── screenshot.png
└── tableview.css
├── gulpfile.js
├── js
├── LineChart.js
└── main.js
├── jsx
├── LineChart.jsx
└── main.jsx
├── lib
└── amcharts
│ ├── amcharts.js
│ ├── exporting
│ ├── amexport.js
│ ├── canvg.js
│ ├── filesaver.js
│ ├── jspdf.js
│ ├── jspdf.plugin.addimage.js
│ └── rgbcolor.js
│ ├── funnel.js
│ ├── gauge.js
│ ├── images
│ ├── dragIcon.gif
│ ├── dragIconBlack.gif
│ ├── dragIconH.gif
│ ├── dragIconHBlack.gif
│ ├── export.png
│ ├── exportWhite.png
│ ├── lens.png
│ └── lensWhite.png
│ ├── lang
│ ├── az.js
│ ├── bg.js
│ ├── de.js
│ ├── es.js
│ ├── fi.js
│ ├── fo.js
│ ├── fr.js
│ ├── hr.js
│ ├── hu.js
│ ├── id.js
│ ├── is.js
│ ├── it.js
│ ├── lt.js
│ ├── lv.js
│ ├── mk.js
│ ├── mn.js
│ ├── mt.js
│ ├── nl.js
│ ├── no.js
│ ├── pl.js
│ ├── pt.js
│ ├── ro.js
│ ├── ru.js
│ ├── rw.js
│ ├── sk.js
│ ├── so.js
│ ├── th.js
│ └── tr.js
│ ├── patterns
│ ├── black
│ │ ├── pattern1.png
│ │ ├── pattern10.png
│ │ ├── pattern11.png
│ │ ├── pattern12.png
│ │ ├── pattern13.png
│ │ ├── pattern14.png
│ │ ├── pattern15.png
│ │ ├── pattern16.png
│ │ ├── pattern17.png
│ │ ├── pattern18.png
│ │ ├── pattern19.png
│ │ ├── pattern2.png
│ │ ├── pattern20.png
│ │ ├── pattern21.png
│ │ ├── pattern3.png
│ │ ├── pattern4.png
│ │ ├── pattern5.png
│ │ ├── pattern6.png
│ │ ├── pattern7.png
│ │ ├── pattern8.png
│ │ └── pattern9.png
│ ├── chalk
│ │ ├── pattern1.jpg
│ │ ├── pattern1r.jpg
│ │ ├── pattern2.jpg
│ │ ├── pattern3.jpg
│ │ ├── pattern4.jpg
│ │ ├── pattern5.jpg
│ │ └── pattern6.jpg
│ └── white
│ │ ├── pattern1.png
│ │ ├── pattern10.png
│ │ ├── pattern11.png
│ │ ├── pattern12.png
│ │ ├── pattern13.png
│ │ ├── pattern14.png
│ │ ├── pattern15.png
│ │ ├── pattern16.png
│ │ ├── pattern17.png
│ │ ├── pattern18.png
│ │ ├── pattern19.png
│ │ ├── pattern2.png
│ │ ├── pattern20.png
│ │ ├── pattern21.png
│ │ ├── pattern3.png
│ │ ├── pattern4.png
│ │ ├── pattern5.png
│ │ ├── pattern6.png
│ │ ├── pattern7.png
│ │ ├── pattern8.png
│ │ └── pattern9.png
│ ├── pie.js
│ ├── plugins
│ ├── dataloader
│ │ ├── dataloader.js
│ │ ├── dataloader.min.js
│ │ ├── examples
│ │ │ ├── data
│ │ │ │ ├── MSFT.csv
│ │ │ │ ├── MSFT_events.csv
│ │ │ │ ├── TXN.csv
│ │ │ │ ├── map.json
│ │ │ │ ├── pie.csv
│ │ │ │ ├── pie.json
│ │ │ │ ├── serial.csv
│ │ │ │ ├── serial.json
│ │ │ │ └── serial2.json
│ │ │ ├── map_json.html
│ │ │ ├── pie_csv.html
│ │ │ ├── pie_json.html
│ │ │ ├── serial2_json.html
│ │ │ ├── serial_csv.html
│ │ │ ├── serial_json.html
│ │ │ └── stock_csv_data_and_events.html
│ │ ├── lang
│ │ │ └── en.js
│ │ ├── license.txt
│ │ └── readme.md
│ └── responsive
│ │ ├── examples
│ │ ├── funnel.html
│ │ ├── gauge.html
│ │ ├── images
│ │ │ ├── bicycle.png
│ │ │ ├── car.png
│ │ │ └── motorcycle.png
│ │ ├── index.html
│ │ ├── map.html
│ │ ├── pie1.html
│ │ ├── pie2.html
│ │ ├── radar.html
│ │ ├── serial1.html
│ │ ├── serial2.html
│ │ ├── serial3.html
│ │ ├── stock.html
│ │ └── xy.html
│ │ ├── license.txt
│ │ ├── readme.md
│ │ ├── responsive.js
│ │ └── responsive.min.js
│ ├── radar.js
│ ├── serial.js
│ ├── themes
│ ├── black.js
│ ├── chalk.js
│ ├── dark.js
│ ├── light.js
│ └── patterns.js
│ └── xy.js
└── package.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .DS_Store
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ##React Amchart Basic Class
2 | =======================
3 |
4 |
5 | ##### Install
6 | ````
7 | npm install
8 | ````
9 |
10 | ##### Usage
11 | ````
12 | gulp
13 | ````
14 |
15 | ## License
16 |
17 | (The MIT License)
--------------------------------------------------------------------------------
/example/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | AmChart Basic Class example
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/example/example.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 | var AmChart = require('../js/main.js');
3 |
4 | // must ensure all of your fields have values or react table view will not render
5 | function generatechartData() {
6 | var chartData = [];
7 | var firstDate = new Date();
8 | firstDate.setDate(firstDate.getDate() - 150);
9 |
10 | for (var i = 0; i < 150; i++) {
11 | // we create date objects here. In your data, you can have date strings
12 | // and then set format of your dates using chart.dataDateFormat property,
13 | // however when possible, use date objects, as this will speed up chart rendering.
14 | var newDate = new Date(firstDate);
15 | newDate.setDate(newDate.getDate() + i);
16 |
17 | var visits = Math.round(Math.random() * 100 - 50);
18 |
19 | chartData.push({
20 | date: newDate,
21 | visits: visits
22 | });
23 | }
24 | return chartData;
25 | }
26 |
27 | React.render(
28 | React.createElement(
29 | AmChart.LineChart, {
30 | data: generatechartData()
31 | }
32 | ),
33 | document.getElementById("container")
34 | );
--------------------------------------------------------------------------------
/example/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zachcr/react-amchart-basic/3bf57cd455252f1ba59382bdab43c7cee2856380/example/screenshot.png
--------------------------------------------------------------------------------
/example/tableview.css:
--------------------------------------------------------------------------------
1 | .react-table-view {
2 | margin: 0;
3 | font-size: 150%;
4 | font-weight: 300;
5 | line-height: 1.5;
6 | }
7 |
8 | .react-table-view table{
9 | background-color: #ffffff;
10 | width:100%;
11 | height:100%;
12 | }
13 |
14 | .react-table-view .pure-table thead {
15 | background: #f7f7f7;
16 |
17 | }
18 | .react-table-view .pure-table thead th,.react-table-view .pure-table thead th td{
19 | border: 1px solid #eee;
20 | padding:5px 20px;
21 | }
22 |
23 | .react-table-view .pure-table tbody tr,.react-table-view .pure-table tbody tr td {
24 | padding: 5px 20px;
25 | border: 1px solid #eee;
26 | }
27 |
28 | /*
29 | .react-table-view .sort-up {
30 | display: inline-block;
31 | margin-left: 0.6em;
32 | border-left: 0.6em solid transparent;
33 | border-right: 0.6em solid transparent;
34 | border-bottom: 0.6em solid #7f7f7f;
35 | }
36 |
37 | .react-table-view .sort-down {
38 | display: inline-block;
39 | margin-left: 0.6em;
40 | border-left: 0.6em solid transparent;
41 | border-right: 0.6em solid transparent;
42 | border-top: 0.6em solid #7f7f7f;
43 | }
44 | */
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var gulp = require('gulp');
2 | var concat = require('gulp-concat');
3 | var react = require('gulp-react');
4 | var bower = require('gulp-bower');
5 | var mainBowerFiles = require('main-bower-files');
6 | var sourcemaps = require('gulp-sourcemaps');
7 | var to5 = require('gulp-6to5');
8 | var es6ModuleTranspiler = require("gulp-es6-module-transpiler");
9 | var notify = require("node-notifier");
10 | var del = require("del");
11 | var opn = require('opn');
12 | var browserify = require('browserify');
13 | var watchify = require('watchify');
14 | var reactify = require('reactify');
15 | var source = require('vinyl-source-stream');
16 | var connect = require('connect');
17 | var connectreload = require('connect-livereload');
18 | var serveStatic = require('serve-static');
19 | var serveIndex = require('serve-index');
20 | var livereload = require('gulp-livereload');
21 |
22 | gulp.task('serve', ['browserify', 'build-web', 'connect', 'watch'],function(){
23 | opn('http://localhost:9000/example/example.html');
24 | });
25 |
26 | gulp.task('connect', function() {
27 | var app = connect()
28 | .use(connectreload({
29 | port: 35729
30 | }))
31 | .use(serveStatic('./'))
32 | .use(serveIndex('./example/example.html'));
33 |
34 | require('http').createServer(app)
35 | .listen(9000)
36 | .on('listening', function() {
37 | console.log('Started connect web server on http://localhost:9000/example/example.html');
38 | });
39 | });
40 |
41 | /* browserify */
42 | gulp.task('browserify', function() {
43 | var bundler = browserify({
44 | entries: ['./example/example.js'], // Only need initial file
45 | transform: [reactify], // Convert JSX to javascript
46 | debug: true,
47 | cache: {},
48 | packageCache: {},
49 | fullPaths: true
50 | });
51 |
52 | var watcher = watchify(bundler);
53 |
54 | return watcher
55 | .on('update', function() { // On update When any files updates
56 | var updateStart = Date.now();
57 | watcher.bundle()
58 | .pipe(source('bundle.js'))
59 | .pipe(gulp.dest('./example/'));
60 | console.log('Updated ', (Date.now() - updateStart) + 'ms');
61 | })
62 | .bundle() // Create initial bundle when starting the task
63 | .pipe(source('bundle.js'))
64 | .pipe(gulp.dest('./example/'));
65 | });
66 |
67 | gulp.task('build-web', function () {
68 | return gulp.src('jsx/*.jsx')
69 | .pipe(sourcemaps.init())
70 | .pipe(react({harmony: true}))
71 | .on('error', function(error) {
72 | console.log(error.fileName, error.message)
73 | notify.notify({
74 | title: error.fileName.replace(__dirname, ''),
75 | message: error.message
76 | })
77 |
78 | this.emit('end')
79 | })
80 | .pipe(es6ModuleTranspiler({type: "amd"}))
81 | .pipe(sourcemaps.write())
82 | .pipe(gulp.dest('./js'));
83 | })
84 |
85 | gulp.task('build', ['build-web'])
86 |
87 | gulp.task('watch', function () {
88 | livereload.listen();
89 |
90 | gulp.watch([
91 | './js/*.js'
92 | ]).on('change', livereload.changed);
93 |
94 | gulp.watch('./jsx/*.jsx', ['build-web']);
95 | })
96 |
97 | gulp.task('default', ['serve']);
98 |
99 | // gulp.task('clean', function(cb) {
100 | // del(['public/js'], cb);
101 | // });
102 |
103 | // gulp.task('build-deps', function () {
104 | // return gulp.src('lib')
105 | // .pipe(concat('vendor.js'))
106 | // .pipe(gulp.dest('public/js'));
107 | // })
--------------------------------------------------------------------------------
/js/LineChart.js:
--------------------------------------------------------------------------------
1 | define("LineChart",
2 | ["react","../lib/amcharts/amcharts","../lib/amcharts/serial","../lib/amcharts/themes/dark","exports"],
3 | function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
4 | "use strict";
5 | /** @jsx React.DOM */
6 | /** @js LineChart.js */
7 | var React = __dependency1__["default"];
8 |
9 | var ____Class5=React.Component;for(var ____Class5____Key in ____Class5){if(____Class5.hasOwnProperty(____Class5____Key)){LineChart[____Class5____Key]=____Class5[____Class5____Key];}}var ____SuperProtoOf____Class5=____Class5===null?null:____Class5.prototype;LineChart.prototype=Object.create(____SuperProtoOf____Class5);LineChart.prototype.constructor=LineChart;LineChart.__superConstructor__=____Class5;function LineChart(){"use strict";if(____Class5!==null){____Class5.apply(this,arguments);}}
10 | LineChart.prototype.componentDidMount=function() {"use strict";
11 | function zoomChart() {
12 | if (chart.zoomToIndexes) {
13 | chart.zoomToIndexes(130, chartData.length - 1);
14 | }
15 | }
16 |
17 | var chart = AmCharts.makeChart('chartdiv', {
18 | "theme": "dark",
19 | "type": "serial",
20 | "autoMargins": false,
21 | "marginLeft": 8,
22 | "marginRight": 8,
23 | "marginTop": 10,
24 | "marginBottom": 26,
25 | "pathToImages": "http://www.amcharts.com/lib/3/images/",
26 | "dataProvider": this.props.data,
27 | "valueAxes": [{
28 | "id": "v1",
29 | "axisAlpha": 0,
30 | "inside": true
31 | }],
32 | "graphs": [{
33 | "useNegativeColorIfDown": true,
34 | "balloonText": "[[category]]
value: [[value]]",
35 | "bullet": "round",
36 | "bulletBorderAlpha": 1,
37 | "bulletBorderColor": "#FFFFFF",
38 | "hideBulletsCount": 50,
39 | "lineThickness": 2,
40 | "lineColor": "#fdd400",
41 | "negativeLineColor": "#67b7dc",
42 | "valueField": "visits"
43 | }],
44 | "chartScrollbar": {},
45 | "chartCursor": {
46 | "valueLineEnabled": true,
47 | "valueLineBalloonEnabled": true
48 | },
49 | "categoryField": "date",
50 | "categoryAxis": {
51 | "parseDates": true,
52 | "axisAlpha": 0,
53 | "minHorizontalGap": 60
54 | }
55 | });
56 |
57 | chart.addListener("dataUpdated", zoomChart);
58 | };
59 |
60 | LineChart.prototype.render=function(){"use strict";
61 | return (
62 | React.DOM.div({id: "chartdiv"})
63 | );
64 | };
65 | ;
66 |
67 | __exports__["default"] = LineChart;
68 | });
69 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlcyI6WyJMaW5lQ2hhcnQuanN4Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanMgTGluZUNoYXJ0LmpzICovXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0ICcuLi9saWIvYW1jaGFydHMvYW1jaGFydHMnO1xuaW1wb3J0ICcuLi9saWIvYW1jaGFydHMvc2VyaWFsJztcbmltcG9ydCAnLi4vbGliL2FtY2hhcnRzL3RoZW1lcy9kYXJrJztcblxuY2xhc3MgTGluZUNoYXJ0IGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgICBjb21wb25lbnREaWRNb3VudCgpIHtcbiAgICAgICAgZnVuY3Rpb24gem9vbUNoYXJ0KCkge1xuICAgICAgICAgICAgaWYgKGNoYXJ0Lnpvb21Ub0luZGV4ZXMpIHtcbiAgICAgICAgICAgICAgICBjaGFydC56b29tVG9JbmRleGVzKDEzMCwgY2hhcnREYXRhLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGNoYXJ0ID0gQW1DaGFydHMubWFrZUNoYXJ0KCdjaGFydGRpdicsIHtcbiAgICAgICAgICAgIFwidGhlbWVcIjogXCJkYXJrXCIsXG4gICAgICAgICAgICBcInR5cGVcIjogXCJzZXJpYWxcIixcbiAgICAgICAgICAgIFwiYXV0b01hcmdpbnNcIjogZmFsc2UsXG4gICAgICAgICAgICBcIm1hcmdpbkxlZnRcIjogOCxcbiAgICAgICAgICAgIFwibWFyZ2luUmlnaHRcIjogOCxcbiAgICAgICAgICAgIFwibWFyZ2luVG9wXCI6IDEwLFxuICAgICAgICAgICAgXCJtYXJnaW5Cb3R0b21cIjogMjYsXG4gICAgICAgICAgICBcInBhdGhUb0ltYWdlc1wiOiBcImh0dHA6Ly93d3cuYW1jaGFydHMuY29tL2xpYi8zL2ltYWdlcy9cIixcbiAgICAgICAgICAgIFwiZGF0YVByb3ZpZGVyXCI6IHRoaXMucHJvcHMuZGF0YSxcbiAgICAgICAgICAgIFwidmFsdWVBeGVzXCI6IFt7XG4gICAgICAgICAgICAgICAgXCJpZFwiOiBcInYxXCIsXG4gICAgICAgICAgICAgICAgXCJheGlzQWxwaGFcIjogMCxcbiAgICAgICAgICAgICAgICBcImluc2lkZVwiOiB0cnVlXG4gICAgICAgICAgICB9XSxcbiAgICAgICAgICAgIFwiZ3JhcGhzXCI6IFt7XG4gICAgICAgICAgICAgICAgXCJ1c2VOZWdhdGl2ZUNvbG9ySWZEb3duXCI6IHRydWUsXG4gICAgICAgICAgICAgICAgXCJiYWxsb29uVGV4dFwiOiBcIltbY2F0ZWdvcnldXTxicj48Yj52YWx1ZTogW1t2YWx1ZV1dPC9iPlwiLFxuICAgICAgICAgICAgICAgIFwiYnVsbGV0XCI6IFwicm91bmRcIixcbiAgICAgICAgICAgICAgICBcImJ1bGxldEJvcmRlckFscGhhXCI6IDEsXG4gICAgICAgICAgICAgICAgXCJidWxsZXRCb3JkZXJDb2xvclwiOiBcIiNGRkZGRkZcIixcbiAgICAgICAgICAgICAgICBcImhpZGVCdWxsZXRzQ291bnRcIjogNTAsXG4gICAgICAgICAgICAgICAgXCJsaW5lVGhpY2tuZXNzXCI6IDIsXG4gICAgICAgICAgICAgICAgXCJsaW5lQ29sb3JcIjogXCIjZmRkNDAwXCIsXG4gICAgICAgICAgICAgICAgXCJuZWdhdGl2ZUxpbmVDb2xvclwiOiBcIiM2N2I3ZGNcIixcbiAgICAgICAgICAgICAgICBcInZhbHVlRmllbGRcIjogXCJ2aXNpdHNcIlxuICAgICAgICAgICAgfV0sXG4gICAgICAgICAgICBcImNoYXJ0U2Nyb2xsYmFyXCI6IHt9LFxuICAgICAgICAgICAgXCJjaGFydEN1cnNvclwiOiB7XG4gICAgICAgICAgICAgICAgXCJ2YWx1ZUxpbmVFbmFibGVkXCI6IHRydWUsXG4gICAgICAgICAgICAgICAgXCJ2YWx1ZUxpbmVCYWxsb29uRW5hYmxlZFwiOiB0cnVlXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJjYXRlZ29yeUZpZWxkXCI6IFwiZGF0ZVwiLFxuICAgICAgICAgICAgXCJjYXRlZ29yeUF4aXNcIjoge1xuICAgICAgICAgICAgICAgIFwicGFyc2VEYXRlc1wiOiB0cnVlLFxuICAgICAgICAgICAgICAgIFwiYXhpc0FscGhhXCI6IDAsXG4gICAgICAgICAgICAgICAgXCJtaW5Ib3Jpem9udGFsR2FwXCI6IDYwXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGNoYXJ0LmFkZExpc3RlbmVyKFwiZGF0YVVwZGF0ZWRcIiwgem9vbUNoYXJ0KTtcbiAgICB9XG5cbiAgICByZW5kZXIoKXtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxkaXYgaWQgPSBcImNoYXJ0ZGl2XCI+PC9kaXY+XG4gICAgICAgICk7XG4gICAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgTGluZUNoYXJ0OyJdLCJmaWxlIjoiTGluZUNoYXJ0LmpzIiwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
--------------------------------------------------------------------------------
/js/main.js:
--------------------------------------------------------------------------------
1 | define("main",
2 | ["./LineChart","exports"],
3 | function(__dependency1__, __exports__) {
4 | "use strict";
5 | /** @jsx React.DOM */
6 | /** @js main.jsx */
7 |
8 | var LineChart = __dependency1__["default"];
9 |
10 | var AmChart = {
11 | LineChart: LineChart
12 | }
13 |
14 | __exports__["default"] = AmChart
15 | });
16 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlcyI6WyJtYWluLmpzeCJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzIG1haW4uanN4ICovXG5cbmltcG9ydCBMaW5lQ2hhcnQgZnJvbSAnLi9MaW5lQ2hhcnQnO1xuXG52YXIgQW1DaGFydCA9IHtcbiAgICBMaW5lQ2hhcnQ6IExpbmVDaGFydFxufVxuXG5leHBvcnQgZGVmYXVsdCBBbUNoYXJ0Il0sImZpbGUiOiJtYWluLmpzIiwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
--------------------------------------------------------------------------------
/jsx/LineChart.jsx:
--------------------------------------------------------------------------------
1 | /** @js LineChart.js */
2 | import React from 'react';
3 | import '../lib/amcharts/amcharts';
4 | import '../lib/amcharts/serial';
5 | import '../lib/amcharts/themes/dark';
6 |
7 | class LineChart extends React.Component {
8 | componentDidMount() {
9 | function zoomChart() {
10 | if (chart.zoomToIndexes) {
11 | chart.zoomToIndexes(130, chartData.length - 1);
12 | }
13 | }
14 |
15 | var chart = AmCharts.makeChart('chartdiv', {
16 | "theme": "dark",
17 | "type": "serial",
18 | "autoMargins": false,
19 | "marginLeft": 8,
20 | "marginRight": 8,
21 | "marginTop": 10,
22 | "marginBottom": 26,
23 | "pathToImages": "http://www.amcharts.com/lib/3/images/",
24 | "dataProvider": this.props.data,
25 | "valueAxes": [{
26 | "id": "v1",
27 | "axisAlpha": 0,
28 | "inside": true
29 | }],
30 | "graphs": [{
31 | "useNegativeColorIfDown": true,
32 | "balloonText": "[[category]]
value: [[value]]",
33 | "bullet": "round",
34 | "bulletBorderAlpha": 1,
35 | "bulletBorderColor": "#FFFFFF",
36 | "hideBulletsCount": 50,
37 | "lineThickness": 2,
38 | "lineColor": "#fdd400",
39 | "negativeLineColor": "#67b7dc",
40 | "valueField": "visits"
41 | }],
42 | "chartScrollbar": {},
43 | "chartCursor": {
44 | "valueLineEnabled": true,
45 | "valueLineBalloonEnabled": true
46 | },
47 | "categoryField": "date",
48 | "categoryAxis": {
49 | "parseDates": true,
50 | "axisAlpha": 0,
51 | "minHorizontalGap": 60
52 | }
53 | });
54 |
55 | chart.addListener("dataUpdated", zoomChart);
56 | }
57 |
58 | render(){
59 | return (
60 |
61 | );
62 | }
63 | };
64 |
65 | export default LineChart;
--------------------------------------------------------------------------------
/jsx/main.jsx:
--------------------------------------------------------------------------------
1 | /** @js main.jsx */
2 |
3 | import LineChart from './LineChart';
4 |
5 | var AmChart = {
6 | LineChart: LineChart
7 | }
8 |
9 | export default AmChart
--------------------------------------------------------------------------------
/lib/amcharts/exporting/filesaver.js:
--------------------------------------------------------------------------------
1 | /* FileSaver.js
2 | * A saveAs() FileSaver implementation.
3 | * 2013-10-21
4 | *
5 | * By Eli Grey, http://eligrey.com
6 | * License: X11/MIT
7 | * See LICENSE.md
8 | */
9 |
10 | /*global self */
11 | /*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
12 | plusplus: true */
13 |
14 | /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
15 | if(AmCharts.isModern){ /// added by AmCharts to avoid old IE problems if this file is included
16 | var saveAs = saveAs
17 | || (typeof navigator !== 'undefined' && navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
18 | || (function(view) {
19 | "use strict";
20 | var
21 | doc = view.document
22 | // only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
23 | , get_URL = function() {
24 | return view.URL || view.webkitURL || view;
25 | }
26 | , URL = view.URL || view.webkitURL || view
27 | , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
28 | , can_use_save_link = !view.externalHost && "download" in save_link
29 | , click = function(node) {
30 | var event = doc.createEvent("MouseEvents");
31 | event.initMouseEvent(
32 | "click", true, false, view, 0, 0, 0, 0, 0
33 | , false, false, false, false, 0, null
34 | );
35 | node.dispatchEvent(event);
36 | }
37 | , webkit_req_fs = view.webkitRequestFileSystem
38 | , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
39 | , throw_outside = function (ex) {
40 | (view.setImmediate || view.setTimeout)(function() {
41 | throw ex;
42 | }, 0);
43 | }
44 | , force_saveable_type = "application/octet-stream"
45 | , fs_min_size = 0
46 | , deletion_queue = []
47 | , process_deletion_queue = function() {
48 | var i = deletion_queue.length;
49 | while (i--) {
50 | var file = deletion_queue[i];
51 | if (typeof file === "string") { // file is an object URL
52 | URL.revokeObjectURL(file);
53 | } else { // file is a File
54 | file.remove();
55 | }
56 | }
57 | deletion_queue.length = 0; // clear queue
58 | }
59 | , dispatch = function(filesaver, event_types, event) {
60 | event_types = [].concat(event_types);
61 | var i = event_types.length;
62 | while (i--) {
63 | var listener = filesaver["on" + event_types[i]];
64 | if (typeof listener === "function") {
65 | try {
66 | listener.call(filesaver, event || filesaver);
67 | } catch (ex) {
68 | throw_outside(ex);
69 | }
70 | }
71 | }
72 | }
73 | , FileSaver = function(blob, name) {
74 | // First try a.download, then web filesystem, then object URLs
75 | var
76 | filesaver = this
77 | , type = blob.type
78 | , blob_changed = false
79 | , object_url
80 | , target_view
81 | , get_object_url = function() {
82 | var object_url = get_URL().createObjectURL(blob);
83 | deletion_queue.push(object_url);
84 | return object_url;
85 | }
86 | , dispatch_all = function() {
87 | dispatch(filesaver, "writestart progress write writeend".split(" "));
88 | }
89 | // on any filesys errors revert to saving with object URLs
90 | , fs_error = function() {
91 | // don't create more object URLs than needed
92 | if (blob_changed || !object_url) {
93 | object_url = get_object_url(blob);
94 | }
95 | if (target_view) {
96 | target_view.location.href = object_url;
97 | } else {
98 | window.open(object_url, "_blank");
99 | }
100 | filesaver.readyState = filesaver.DONE;
101 | dispatch_all();
102 | }
103 | , abortable = function(func) {
104 | return function() {
105 | if (filesaver.readyState !== filesaver.DONE) {
106 | return func.apply(this, arguments);
107 | }
108 | };
109 | }
110 | , create_if_not_found = {create: true, exclusive: false}
111 | , slice
112 | ;
113 | filesaver.readyState = filesaver.INIT;
114 | if (!name) {
115 | name = "download";
116 | }
117 | if (can_use_save_link) {
118 | object_url = get_object_url(blob);
119 | // FF for Android has a nasty garbage collection mechanism
120 | // that turns all objects that are not pure javascript into 'deadObject'
121 | // this means `doc` and `save_link` are unusable and need to be recreated
122 | // `view` is usable though:
123 | doc = view.document;
124 | save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
125 | save_link.href = object_url;
126 | save_link.download = name;
127 | var event = doc.createEvent("MouseEvents");
128 | event.initMouseEvent(
129 | "click", true, false, view, 0, 0, 0, 0, 0
130 | , false, false, false, false, 0, null
131 | );
132 | save_link.dispatchEvent(event);
133 | filesaver.readyState = filesaver.DONE;
134 | dispatch_all();
135 | return;
136 | }
137 | // Object and web filesystem URLs have a problem saving in Google Chrome when
138 | // viewed in a tab, so I force save with application/octet-stream
139 | // http://code.google.com/p/chromium/issues/detail?id=91158
140 | if (view.chrome && type && type !== force_saveable_type) {
141 | slice = blob.slice || blob.webkitSlice;
142 | blob = slice.call(blob, 0, blob.size, force_saveable_type);
143 | blob_changed = true;
144 | }
145 | // Since I can't be sure that the guessed media type will trigger a download
146 | // in WebKit, I append .download to the filename.
147 | // https://bugs.webkit.org/show_bug.cgi?id=65440
148 | if (webkit_req_fs && name !== "download") {
149 | name += ".download";
150 | }
151 | if (type === force_saveable_type || webkit_req_fs) {
152 | target_view = view;
153 | }
154 | if (!req_fs) {
155 | fs_error();
156 | return;
157 | }
158 | fs_min_size += blob.size;
159 | req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {
160 | fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) {
161 | var save = function() {
162 | dir.getFile(name, create_if_not_found, abortable(function(file) {
163 | file.createWriter(abortable(function(writer) {
164 | writer.onwriteend = function(event) {
165 | target_view.location.href = file.toURL();
166 | deletion_queue.push(file);
167 | filesaver.readyState = filesaver.DONE;
168 | dispatch(filesaver, "writeend", event);
169 | };
170 | writer.onerror = function() {
171 | var error = writer.error;
172 | if (error.code !== error.ABORT_ERR) {
173 | fs_error();
174 | }
175 | };
176 | "writestart progress write abort".split(" ").forEach(function(event) {
177 | writer["on" + event] = filesaver["on" + event];
178 | });
179 | writer.write(blob);
180 | filesaver.abort = function() {
181 | writer.abort();
182 | filesaver.readyState = filesaver.DONE;
183 | };
184 | filesaver.readyState = filesaver.WRITING;
185 | }), fs_error);
186 | }), fs_error);
187 | };
188 | dir.getFile(name, {create: false}, abortable(function(file) {
189 | // delete file if it already exists
190 | file.remove();
191 | save();
192 | }), abortable(function(ex) {
193 | if (ex.code === ex.NOT_FOUND_ERR) {
194 | save();
195 | } else {
196 | fs_error();
197 | }
198 | }));
199 | }), fs_error);
200 | }), fs_error);
201 | }
202 | , FS_proto = FileSaver.prototype
203 | , saveAs = function(blob, name) {
204 | return new FileSaver(blob, name);
205 | }
206 | ;
207 | FS_proto.abort = function() {
208 | var filesaver = this;
209 | filesaver.readyState = filesaver.DONE;
210 | dispatch(filesaver, "abort");
211 | };
212 | FS_proto.readyState = FS_proto.INIT = 0;
213 | FS_proto.WRITING = 1;
214 | FS_proto.DONE = 2;
215 |
216 | FS_proto.error =
217 | FS_proto.onwritestart =
218 | FS_proto.onprogress =
219 | FS_proto.onwrite =
220 | FS_proto.onabort =
221 | FS_proto.onerror =
222 | FS_proto.onwriteend =
223 | null;
224 |
225 | view.addEventListener("unload", process_deletion_queue, false);
226 | return saveAs;
227 | }(this.self || this.window || this.content));
228 | // `self` is undefined in Firefox for Android content script context
229 | // while `this` is nsIContentFrameMessageManager
230 | // with an attribute `content` that corresponds to the window
231 |
232 | if (typeof module !== 'undefined') module.exports = saveAs;
233 | }/// added by AmCharts to avoid old IE problems if this file is included
--------------------------------------------------------------------------------
/lib/amcharts/exporting/jspdf.plugin.addimage.js:
--------------------------------------------------------------------------------
1 | /** @preserve
2 | jsPDF addImage plugin (JPEG only at this time)
3 | Copyright (c) 2012 https://github.com/siefkenj/
4 | */
5 |
6 | /**
7 | * Permission is hereby granted, free of charge, to any person obtaining
8 | * a copy of this software and associated documentation files (the
9 | * "Software"), to deal in the Software without restriction, including
10 | * without limitation the rights to use, copy, modify, merge, publish,
11 | * distribute, sublicense, and/or sell copies of the Software, and to
12 | * permit persons to whom the Software is furnished to do so, subject to
13 | * the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be
16 | * included in all copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 | * ====================================================================
26 | */
27 |
28 | ;(function(jsPDFAPI) {
29 | 'use strict'
30 |
31 | var namespace = 'addImage_'
32 |
33 | // takes a string imgData containing the raw bytes of
34 | // a jpeg image and returns [width, height]
35 | // Algorithm from: http://www.64lines.com/jpeg-width-height
36 | var getJpegSize = function(imgData) {
37 | 'use strict'
38 | var width, height;
39 | // Verify we have a valid jpeg header 0xff,0xd8,0xff,0xe0,?,?,'J','F','I','F',0x00
40 | if (!imgData.charCodeAt(0) === 0xff ||
41 | !imgData.charCodeAt(1) === 0xd8 ||
42 | !imgData.charCodeAt(2) === 0xff ||
43 | !imgData.charCodeAt(3) === 0xe0 ||
44 | !imgData.charCodeAt(6) === 'J'.charCodeAt(0) ||
45 | !imgData.charCodeAt(7) === 'F'.charCodeAt(0) ||
46 | !imgData.charCodeAt(8) === 'I'.charCodeAt(0) ||
47 | !imgData.charCodeAt(9) === 'F'.charCodeAt(0) ||
48 | !imgData.charCodeAt(10) === 0x00) {
49 | throw new Error('getJpegSize requires a binary jpeg file')
50 | }
51 | var blockLength = imgData.charCodeAt(4)*256 + imgData.charCodeAt(5);
52 | var i = 4, len = imgData.length;
53 | while ( i < len ) {
54 | i += blockLength;
55 | if (imgData.charCodeAt(i) !== 0xff) {
56 | throw new Error('getJpegSize could not find the size of the image');
57 | }
58 | if (imgData.charCodeAt(i+1) === 0xc0 || //(SOF) Huffman - Baseline DCT
59 | imgData.charCodeAt(i+1) === 0xc1 || //(SOF) Huffman - Extended sequential DCT
60 | imgData.charCodeAt(i+1) === 0xc2 || // Progressive DCT (SOF2)
61 | imgData.charCodeAt(i+1) === 0xc3 || // Spatial (sequential) lossless (SOF3)
62 | imgData.charCodeAt(i+1) === 0xc4 || // Differential sequential DCT (SOF5)
63 | imgData.charCodeAt(i+1) === 0xc5 || // Differential progressive DCT (SOF6)
64 | imgData.charCodeAt(i+1) === 0xc6 || // Differential spatial (SOF7)
65 | imgData.charCodeAt(i+1) === 0xc7) {
66 | height = imgData.charCodeAt(i+5)*256 + imgData.charCodeAt(i+6);
67 | width = imgData.charCodeAt(i+7)*256 + imgData.charCodeAt(i+8);
68 | return [width, height];
69 | } else {
70 | i += 2;
71 | blockLength = imgData.charCodeAt(i)*256 + imgData.charCodeAt(i+1)
72 | }
73 | }
74 | }
75 | // Image functionality ported from pdf.js
76 | , putImage = function(img) {
77 | var objectNumber = this.internal.newObject()
78 | , out = this.internal.write
79 | , putStream = this.internal.putStream
80 |
81 | img['n'] = objectNumber
82 |
83 | out('<>');
103 | }
104 | if ('trns' in img && img['trns'].constructor == Array) {
105 | var trns = '';
106 | for ( var i = 0; i < img['trns'].length; i++) {
107 | trns += (img[trns][i] + ' ' + img['trns'][i] + ' ');
108 | out('/Mask [' + trns + ']');
109 | }
110 | }
111 | if ('smask' in img) {
112 | out('/SMask ' + (objectNumber + 1) + ' 0 R');
113 | }
114 | out('/Length ' + img['data'].length + '>>');
115 |
116 | putStream(img['data']);
117 |
118 | out('endobj');
119 | }
120 | , putResourcesCallback = function() {
121 | var images = this.internal.collections[namespace + 'images']
122 | for ( var i in images ) {
123 | putImage.call(this, images[i])
124 | }
125 | }
126 | , putXObjectsDictCallback = function(){
127 | var images = this.internal.collections[namespace + 'images']
128 | , out = this.internal.write
129 | , image
130 | for (var i in images) {
131 | image = images[i]
132 | out(
133 | '/I' + image['i']
134 | , image['n']
135 | , '0'
136 | , 'R'
137 | )
138 | }
139 | }
140 |
141 | jsPDFAPI.addImage = function(imageData, format, x, y, w, h) {
142 | 'use strict'
143 | if (typeof imageData === 'object' && imageData.nodeType === 1) {
144 | var canvas = document.createElement('canvas');
145 | canvas.width = imageData.clientWidth;
146 | canvas.height = imageData.clientHeight;
147 |
148 | var ctx = canvas.getContext('2d');
149 | if (!ctx) {
150 | throw ('addImage requires canvas to be supported by browser.');
151 | }
152 | ctx.drawImage(imageData, 0, 0, canvas.width, canvas.height);
153 | imageData = canvas.toDataURL('image/jpeg');
154 | format = "JPEG";
155 | }
156 | if (format.toUpperCase() !== 'JPEG') {
157 | throw new Error('addImage currently only supports format \'JPEG\', not \''+format+'\'');
158 | }
159 |
160 | var imageIndex
161 | , images = this.internal.collections[namespace + 'images']
162 | , coord = this.internal.getCoordinateString
163 | , vcoord = this.internal.getVerticalCoordinateString;
164 |
165 | // Detect if the imageData is raw binary or Data URL
166 | if (imageData.substring(0, 23) === 'data:image/jpeg;base64,') {
167 | imageData = atob(imageData.replace('data:image/jpeg;base64,', ''));
168 | }
169 |
170 | if (images){
171 | // this is NOT the first time this method is ran on this instance of jsPDF object.
172 | imageIndex = Object.keys ?
173 | Object.keys(images).length :
174 | (function(o){
175 | var i = 0
176 | for (var e in o){if(o.hasOwnProperty(e)){ i++ }}
177 | return i
178 | })(images)
179 | } else {
180 | // this is the first time this method is ran on this instance of jsPDF object.
181 | imageIndex = 0
182 | this.internal.collections[namespace + 'images'] = images = {}
183 | this.internal.events.subscribe('putResources', putResourcesCallback)
184 | this.internal.events.subscribe('putXobjectDict', putXObjectsDictCallback)
185 | }
186 |
187 | var dims = getJpegSize(imageData);
188 | var info = {
189 | w : dims[0],
190 | h : dims[1],
191 | cs : 'DeviceRGB',
192 | bpc : 8,
193 | f : 'DCTDecode',
194 | i : imageIndex,
195 | data : imageData
196 | // n: objectNumber will be added by putImage code
197 |
198 | };
199 | images[imageIndex] = info
200 | if (!w && !h) {
201 | w = -96;
202 | h = -96;
203 | }
204 | if (w < 0) {
205 | w = (-1) * info['w'] * 72 / w / this.internal.scaleFactor;
206 | }
207 | if (h < 0) {
208 | h = (-1) * info['h'] * 72 / h / this.internal.scaleFactor;
209 | }
210 | if (w === 0) {
211 | w = h * info['w'] / info['h'];
212 | }
213 | if (h === 0) {
214 | h = w * info['h'] / info['w'];
215 | }
216 |
217 | this.internal.write(
218 | 'q'
219 | , coord(w)
220 | , '0 0'
221 | , coord(h) // TODO: check if this should be shifted by vcoord
222 | , coord(x)
223 | , vcoord(y + h)
224 | , 'cm /I'+info['i']
225 | , 'Do Q'
226 | )
227 |
228 | return this
229 | }
230 | })(jsPDF.API)
--------------------------------------------------------------------------------
/lib/amcharts/funnel.js:
--------------------------------------------------------------------------------
1 | AmCharts.AmFunnelChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(g){this.type="funnel";AmCharts.AmFunnelChart.base.construct.call(this,g);this.cname="AmFunnelChart";this.startX=this.startY=0;this.baseWidth="100%";this.neckHeight=this.neckWidth=0;this.rotate=!1;this.valueRepresents="height";this.pullDistance=30;this.labelPosition="center";this.labelText="[[title]]: [[value]]";this.balloonText="[[title]]: [[value]]\n[[description]]";AmCharts.applyTheme(this,g,this.cname)},drawChart:function(){AmCharts.AmFunnelChart.base.drawChart.call(this);
2 | var g=this.chartData;if(AmCharts.ifArray(g))if(0l&&(this.neckHeight=
3 | this.neckWidth=0,e?f-=l/2:a-=l/2);var p=m-n-p,B=AmCharts.toCoordinate(this.baseWidth,p),I=AmCharts.toCoordinate(this.neckWidth,p),D=x-f-a,E=AmCharts.toCoordinate(this.neckHeight,D),y=a+D-E;e&&(a=x-f,y=a-D+E);this.firstSliceY=a;AmCharts.VML&&(this.startAlpha=1);for(var z=p/2+n,F=(D-E)/((B-I)/2),A=1,q=B/2,B=(D-E)*(B+I)/2+I*E,G=a,L=0,E=0;Ek&&(k=0);k=(Math.sqrt(k)-J)/(2*r);if(!e&&a>=y||e&&a<=y)k=2*-C/I;else if(!e&&a+k>y||e&&a-ky||e&&a-ky&&(r=0),w.push(a,a,a+r,a+k,a+k,a+r,a)),J=!0):(u.push(z-q,z+q,z+C,z-C),e?w.push(a,a,a-k,a-k):w.push(a,a,a+k,a+k));b.set();r=b.set();0l?(w=C/q,u=-1,e||(u=1),isNaN(A)&&
5 | (A=0),u=(new AmCharts.Cuboid(b,2*q,u*k,d,l*A,h.color,h.alpha,this.outlineThickness,this.outlineColor,this.outlineAlpha,90,0,!1,0,h.pattern,w)).set,u.translate(z-q,a-l/2*A),A*=w):u=AmCharts.polygon(b,u,w,h.color,h.alpha,this.outlineThickness,this.outlineColor,this.outlineAlpha);AmCharts.setCN(this,r,"funnel-item");AmCharts.setCN(this,u,"funnel-slice");AmCharts.setCN(this,r,h.className,!0);r.push(u);this.graphsSet.push(r);e||r.toBack();h.wedge=r;h.index=E;if(w=this.gradientRatio){var v=[],t;for(t=0;t<
6 | w.length;t++)v.push(AmCharts.adjustLuminosity(h.color,w[t]));0=this.hideLabelsPercent){v=this.formatString(this.labelText,h);(u=this.labelFunction)&&(v=u(h,v));t=h.labelColor;t||(t=this.color);var w=this.labelPosition,H="left";"center"==w&&(H="middle");"left"==w&&(H="right");
7 | u=void 0;""!=v&&(u=AmCharts.wrappedText(b,v,t,this.fontFamily,this.fontSize,H,!1,this.maxLabelWidth),AmCharts.setCN(this,u,"funnel-label"),AmCharts.setCN(this,u,h.className,!0),u.node.style.pointerEvents="none",r.push(u),v=z,e?(t=a-k/2,h.ty0=t):(t=a+k/2,h.ty0=t,tx-f&&(t=x-f)),"right"==w&&(v=p+10+n,h.tx0=z+(q-k/2/F),J&&(h.tx0=z+C)),"left"==w&&(h.tx0=z-(q-k/2/F),J&&(h.tx0=z-C),v=n),h.label=u,h.labelX=v,h.labelY=t,h.labelHeight=u.getBBox().height,u.translate(v,t),q=u.getBBox(),G=
8 | AmCharts.rect(b,q.width+5,q.height+5,"#ffffff",.005),G.translate(v+q.x,t+q.y),r.push(G),h.hitRect=G,L=u.getBBox().height,G=t)}(0===h.alpha||0f&&(a=d+l+5):f+p+5>d&&(a=d-5-p);d=a;l=p;if(x){x.translate(n,a);var B=x.getBBox()}e.hitRect&&e.hitRect.translate(n+B.x,a+B.y);e.labelY=a;e.tx=n;e.ty=a;e.tx2=n}"center"!=this.labelPosition&&this.drawTicks()}});AmCharts.Cuboid=AmCharts.Class({construct:function(g,d,l,b,c,e,m,x,f,n,p,a,B,I,D,E,y){this.set=g.set();this.container=g;this.h=Math.round(l);this.w=Math.round(d);this.dx=b;this.dy=c;this.colors=e;this.alpha=m;this.bwidth=x;this.bcolor=f;this.balpha=n;this.dashLength=I;this.topRadius=E;this.pattern=D;this.rotate=B;this.bcn=y;B?0>d&&0===p&&(p=180):0>l&&270==p&&(p=90);this.gradientRotation=p;0===b&&0===c&&(this.cornerRadius=a);this.draw()},draw:function(){var g=this.set;g.clear();var d=this.container,
10 | l=d.chart,b=this.w,c=this.h,e=this.dx,m=this.dy,x=this.colors,f=this.alpha,n=this.bwidth,p=this.bcolor,a=this.balpha,B=this.gradientRotation,I=this.cornerRadius,D=this.dashLength,E=this.pattern,y=this.topRadius,z=this.bcn,F=x,A=x;"object"==typeof x&&(F=x[0],A=x[x.length-1]);var q,G,L,h,r,u,w,k,C,J=f;E&&(f=0);var v,t,H,K,M=this.rotate;if(0Math.abs(c)&&(c=0);1>Math.abs(b)&&(b=0);!isNaN(y)&&(0c&&(n=" A"),f+=n+Math.round(b/2-H)+","+Math.round(c-K)+
14 | ","+Math.round(b/2+H)+","+Math.round(c+K)+",0,"+c+","+b+","+c,f+=" L"+b+",0",f+=n+Math.round(b/2+v)+","+Math.round(t)+","+Math.round(b/2-v)+","+Math.round(-t)+","+b+",0,0,0"):(f+="A"+H+","+K+",0,0,0,"+(b-b/2*(1-y))+","+c+"L"+b+",0",f+="A"+v+","+t+",0,0,1,0,0"),v=180),d=d.path(f).attr(x),d.gradient("linearGradient",[F,AmCharts.adjustLuminosity(F,-.3),AmCharts.adjustLuminosity(F,-.3),F],v),M?d.translate(e/2,0):d.translate(0,m/2)):d=0===c?AmCharts.line(d,[0,b],[0,0],p,a,n,D):0===b?AmCharts.line(d,[0,
15 | 0],[0,c],p,a,n,D):0c?[q,C,G,L,h,r,u,w,k,d]:[w,k,G,L,h,r,q,C,u,d]:M?0c?[q,d,w]:[w,d,q];AmCharts.setCN(l,d,z+"front");AmCharts.setCN(l,G,z+"back");AmCharts.setCN(l,w,z+"top");AmCharts.setCN(l,q,z+"bottom");AmCharts.setCN(l,h,z+"left");AmCharts.setCN(l,r,z+"right");for(q=0;qthis.maxLabelWidth&&(q=this.maxLabelWidth);this.labelText&&this.labelsEnabled||(w=q=0);x=void 0===this.pieX?(b-l-a)/2+l:d(this.pieX,this.realWidth);y=void 0===this.pieY?(k-u-m)/2+u:d(this.pieY,k);g=d(this.radius,b,k);g||(b=0<=w?b-l-a-2*q:b-l-a,k=k-u-m,g=Math.min(b,k),kb&&(g=b)),k=AmCharts.toCoordinate(this.pullOutRadius,g),g=(0<=w?g-1.8*(w+k):g-1.8*k)/2);g=g&&(d=g-1);m=AmCharts.fitToBounds(this.startAngle,0,360);0=this.hideLabelsPercent){var h=m+p/2;360=h&&0<=h?(C=0,B="start",v=8):90<=h&&180>h?(C=1,B="start",v=8):180<=h&&270>h?(C=2,B="end",v=-8):270<=h&&360>h&&(C=3,B="end",v=-8);a.labelQuarter=C}else B="middle";var h=this.formatString(this.labelText,a),t=this.labelFunction;t&&(h=t(a,h));t=a.labelColor;t||(t=this.color);""!=h&&(h=AmCharts.wrappedText(c,h,t,this.fontFamily,this.fontSize,B,!1,this.maxLabelWidth),AmCharts.setCN(this,h,"pie-label"),AmCharts.setCN(this,h,a.className,!0),
7 | h.translate(p+1.5*v,A),h.node.style.pointerEvents="none",a.tx=p+1.5*v,a.ty=A,0<=r?(r=h.getBBox(),t=AmCharts.rect(c,r.width+5,r.height+5,"#FFFFFF",.005),t.translate(p+1.5*v+r.x,A+r.y),a.hitRect=t,n.push(h),n.push(t)):this.freeLabelsSet.push(h),a.label=h);a.tx=p;a.tx2=p+v;a.tx0=x+q*g;a.ty0=y+z*g}p=d+(g-d)/2;a.pulled&&(p+=this.pullOutRadiusReal);a.balloonX=q*p+x;a.balloonY=z*p+y;a.startX=Math.round(q*u);a.startY=Math.round(z*u);a.pullX=Math.round(q*k);a.pullY=Math.round(z*k);this.graphsSet.push(n);(0===
8 | a.alpha||0c?b.toFront():180<=c&&b.toBack()}},arrangeLabels:function(){var e=
9 | this.chartData,f=e.length,c,b;for(b=f-1;0<=b;b--)c=e[b],0!==c.labelQuarter||c.hidden||this.checkOverlapping(b,c,0,!0,0);for(b=0;bk&&(d=f.ty+3*f.iy,f.ty=d,m.translate(f.tx2,d),f.hitRect&&(m=m.getBBox(),f.hitRect.translate(f.tx2+m.x,d+m.y)),this.checkOverlapping(e,f,c,b,k+1))}},checkOverlappingReal:function(e,f,c){var b=!1,k=e.label,d=f.label;e.labelQuarter!=c||e.hidden||f.hidden||!d||(k=k.getBBox(),c={},c.width=k.width,c.height=k.height,c.y=e.ty,c.x=e.tx,e=d.getBBox(),d={},
11 | d.width=e.width,d.height=e.height,d.y=f.ty,d.x=f.tx,AmCharts.hitTest(c,d)&&(b=!0));return b}});
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/dataloader.min.js:
--------------------------------------------------------------------------------
1 | AmCharts.addInitHandler(function(chart){function loadFile(a,b,c,d){if(void 0===d&&(d="dataProvider"),c.showCurtain&&showCurtain(void 0,c.noStyles),l.remaining++,window.XMLHttpRequest)var e=new XMLHttpRequest;else var e=new ActiveXObject("Microsoft.XMLHTTP");e.onreadystatechange=function(){if(4==e.readyState&&404==e.status)raiseError(__("Error loading the file")+": "+a,!1,c);else if(4==e.readyState&&200==e.status){switch(void 0===c.format&&(c.format="json"),c.format=c.format.toLowerCase(),c.format){case"json":b[d]=postprocess(parseJSON(e.responseText,c),c);break;case"csv":b[d]=postprocess(parseCSV(e.responseText,c),c);break;default:raiseError(__("Unsupported data format")+": "+c.format,f,c.noStyles)}if(l.remaining--,0===l.remaining){if(c.async)if("map"===chart.type)chart.validateNow(!0);else if(chart.validateData(),l.startDuration)if("stock"===chart.type){chart.panelsSettings.startDuration=l.startDuration;for(var g in chart.panels)chart.panels[g].startDuration=l.startDuration,chart.panels[g].animateAgain()}else chart.startDuration=l.startDuration,chart.animateAgain();"stock"!==chart.type||c.reloading||chart.periodSelector.setDefaultPeriod(),removeCurtain()}c.reload&&(c.timeout&&clearTimeout(c.timeout),c.timeout=setTimeout(loadFile,1e3*c.reload,a,b,c),c.reloading=!0)}};try{e.open("GET",c.timestamp?timestampUrl(a):a,c.async),e.send()}catch(f){raiseError(__("Error loading the file")+": "+a,f,c)}}function parseJSON(response,options){try{return void 0!==JSON?JSON.parse(response):eval(response)}catch(e){return raiseError(__("Error parsing JSON file")+": "+l.url,e,options),[]}}function parseCSV(a,b){var c=CSVToArray(a,b.delimiter),d=[],e=[];b.useColumnNames&&(e=c.shift(),0'+a+""):c.innerHTML=a,chart.containerDiv.appendChild(c),l.curtain=c}function removeCurtain(){try{void 0!==l.curtain&&chart.containerDiv.removeChild(l.curtain)}catch(a){}l.curtain=void 0}function timestampUrl(a){var b=a.split("?");return 1===b.length?b[1]=(new Date).getTime():b[1]+="&"+(new Date).getTime(),b.join("?")}function CSVToArray(a,b){b=b||",";for(var c=new RegExp("(\\"+b+"|\\r?\\n|\\r|^)"+'(?:"([^"]*(?:""[^"]*)*)"|'+'([^"\\'+b+"\\r\\n]*))","gi"),d=[[]],e=null;e=c.exec(a);){var f=e[1];if(f.length&&f!=b&&d.push([]),e[2])var g=e[2].replace(new RegExp('""',"g"),'"');else var g=e[3];d[d.length-1].push(g)}return d}void 0!==chart.dataLoader&&isObject(chart.dataLoader)||(chart.dataLoader={});var version=chart.version.split(".");if(!(Number(version[0])<3||3==Number(version[0])&&Number(version[1])<13)){var l=chart.dataLoader;l.remaining=0;var defaults={async:!0,format:"json",showErrors:!0,showCurtain:!0,noStyles:!1,reload:0,timestamp:!1,delimiter:",",skip:0,useColumnNames:!1,reverse:!1,reloading:!1};if("stock"===chart.type)setTimeout(function(){0>chart.panelsSettings.startDuration&&(l.startDuration=chart.panelsSettings.startDuration,chart.panelsSettings.startDuration=0);for(var a in chart.dataSets){var b=chart.dataSets[a];void 0!==b.dataLoader&&void 0!==b.dataLoader.url&&(b.dataProvider=[],applyDefaults(b.dataLoader),loadFile(b.dataLoader.url,b,b.dataLoader,"dataProvider")),void 0!==b.eventDataLoader&&void 0!==b.eventDataLoader.url&&(b.events=[],applyDefaults(b.eventDataLoader),loadFile(b.eventDataLoader.url,b,b.eventDataLoader,"stockEvents"))}},100);else{if(applyDefaults(l),void 0===l.url)return;void 0!==chart.startDuration&&0Texas is the second most populous (after California) and the second largest of the 50 U.S. states (after Alaska) in the United States of America, and the largest state in the 48 contiguous United States. Geographically located in the south central part of the country, Texas shares an international border with the Mexican states of Chihuahua, Coahuila, Nuevo León, and Tamaulipas to the south and borders the U.S. states of New Mexico to the west, Oklahoma to the north, Arkansas to the northeast, and Louisiana to the east. Texas has an area of 268,820 square miles (696,200 km2) and a growing population of over 26.9 million residents (July 2014)."
133 | }, {
134 | "id": "US-UT",
135 | "value": 2233169
136 | }, {
137 | "id": "US-VT",
138 | "value": 608827
139 | }, {
140 | "id": "US-VA",
141 | "value": 7078515
142 | }, {
143 | "id": "US-WA",
144 | "value": 5894121
145 | }, {
146 | "id": "US-WV",
147 | "value": 1808344
148 | }, {
149 | "id": "US-WI",
150 | "value": 5363675
151 | }, {
152 | "id": "US-WY",
153 | "value": 493782
154 | }]
155 | }
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/data/pie.csv:
--------------------------------------------------------------------------------
1 | country,litres
2 | "Czech Republic",156.9
3 | "Ireland",131.1
4 | "Germany",115.8
5 | "Australia",109.9
6 | "Austria",108.3
7 | "UK",65
8 | "Belgium",50
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/data/pie.json:
--------------------------------------------------------------------------------
1 | [{
2 | "country": "Czech Republic",
3 | "litres": 156.9
4 | }, {
5 | "country": "Ireland",
6 | "litres": 131.1
7 | }, {
8 | "country": "Germany",
9 | "litres": 115.8
10 | }, {
11 | "country": "Australia",
12 | "litres": 109.9
13 | }, {
14 | "country": "Austria",
15 | "litres": 108.3
16 | }, {
17 | "country": "UK",
18 | "litres": 65
19 | }, {
20 | "country": "Belgium",
21 | "litres": 50
22 | }]
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/data/serial.csv:
--------------------------------------------------------------------------------
1 | year,cars,motorcycles,bicycles
2 | 2000,1587,650,121
3 | 1995,1567,683,146
4 | 1996,1617,691,138
5 | 1997,1630,642,127
6 | 1998,1660,699,105
7 | 1999,1683,721,109
8 | 2000,1691,737,112
9 | 2001,1298,680,101
10 | 2002,1275,664,97
11 | 2003,1246,648,93
12 | 2004,1218,637,101
13 | 2005,1213,633,87
14 | 2006,1199,621,79
15 | 2007,1110,210,81
16 | 2008,1165,232,75
17 | 2009,1145,219,88
18 | 2010,1163,201,82
19 | 2011,1180,285,87
20 | 2012,1159,277,71
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/data/serial.json:
--------------------------------------------------------------------------------
1 | [{
2 | "year": 2000,
3 | "cars": 1587,
4 | "motorcycles": 650,
5 | "bicycles": 121
6 | }, {
7 | "year": 1995,
8 | "cars": 1567,
9 | "motorcycles": 683,
10 | "bicycles": 146
11 | }, {
12 | "year": 1996,
13 | "cars": 1617,
14 | "motorcycles": 691,
15 | "bicycles": 138
16 | }, {
17 | "year": 1997,
18 | "cars": 1630,
19 | "motorcycles": 642,
20 | "bicycles": 127
21 | }, {
22 | "year": 1998,
23 | "cars": 1660,
24 | "motorcycles": 699,
25 | "bicycles": 105
26 | }, {
27 | "year": 1999,
28 | "cars": 1683,
29 | "motorcycles": 721,
30 | "bicycles": 109
31 | }, {
32 | "year": 2000,
33 | "cars": 1691,
34 | "motorcycles": 737,
35 | "bicycles": 112
36 | }, {
37 | "year": 2001,
38 | "cars": 1298,
39 | "motorcycles": 680,
40 | "bicycles": 101
41 | }, {
42 | "year": 2002,
43 | "cars": 1275,
44 | "motorcycles": 664,
45 | "bicycles": 97
46 | }, {
47 | "year": 2003,
48 | "cars": 1246,
49 | "motorcycles": 648,
50 | "bicycles": 93
51 | }, {
52 | "year": 2004,
53 | "cars": 1218,
54 | "motorcycles": 637,
55 | "bicycles": 101
56 | }, {
57 | "year": 2005,
58 | "cars": 1213,
59 | "motorcycles": 633,
60 | "bicycles": 87
61 | }, {
62 | "year": 2006,
63 | "cars": 1199,
64 | "motorcycles": 621,
65 | "bicycles": 79
66 | }, {
67 | "year": 2007,
68 | "cars": 1110,
69 | "motorcycles": 210,
70 | "bicycles": 81
71 | }, {
72 | "year": 2008,
73 | "cars": 1165,
74 | "motorcycles": 232,
75 | "bicycles": 75
76 | }, {
77 | "year": 2009,
78 | "cars": 1145,
79 | "motorcycles": 219,
80 | "bicycles": 88
81 | }, {
82 | "year": 2010,
83 | "cars": 1163,
84 | "motorcycles": 201,
85 | "bicycles": 82
86 | }, {
87 | "year": 2011,
88 | "cars": 1180,
89 | "motorcycles": 285,
90 | "bicycles": 87
91 | }, {
92 | "year": 2012,
93 | "cars": 1159,
94 | "motorcycles": 277,
95 | "bicycles": 71
96 | }]
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/data/serial2.json:
--------------------------------------------------------------------------------
1 | [{
2 | "year": 2005,
3 | "income": 23.5,
4 | "expenses": 18.1
5 | }, {
6 | "year": 2006,
7 | "income": 26.2,
8 | "expenses": 22.8
9 | }, {
10 | "year": 2007,
11 | "income": 30.1,
12 | "expenses": 23.9
13 | }, {
14 | "year": 2008,
15 | "income": 29.5,
16 | "expenses": 25.1
17 | }, {
18 | "year": 2009,
19 | "income": 24.6,
20 | "expenses": 25
21 | }]
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/map_json.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
12 |
22 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/pie_csv.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Data Loader Example
8 |
9 |
10 |
11 |
21 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/pie_json.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Data Loader Example
8 |
9 |
10 |
11 |
21 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/serial2_json.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Data Loader Example
8 |
9 |
10 |
11 |
12 |
23 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/serial_csv.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Data Loader Example
8 |
9 |
10 |
11 |
21 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/serial_json.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Data Loader Example
8 |
9 |
10 |
11 |
21 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/examples/stock_csv_data_and_events.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Data Loader Example
8 |
9 |
10 |
11 |
12 |
44 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/lang/en.js:
--------------------------------------------------------------------------------
1 | AmCharts.translations.dataLoader.en = {
2 | 'Error loading file': 'Error loading file',
3 | 'Error parsing JSON file': 'Error parsing JSON file',
4 | 'Unsupported data format': 'Unsupported data format',
5 | 'Loading data...': 'Loading data...'
6 | }
--------------------------------------------------------------------------------
/lib/amcharts/plugins/dataloader/readme.md:
--------------------------------------------------------------------------------
1 | # amCharts Data Loader
2 |
3 | Version: 0.9.1
4 |
5 |
6 | ## Description
7 |
8 | By default all amCharts libraries accept data in JSON format. It needs to be
9 | there when the web page loads, defined in-line or loaded via custom code.
10 |
11 | This plugin introduces are native wrapper that enables automatic loading of data
12 | from external data data sources in CSV and JSON formats.
13 |
14 | Most of the times you will just need to provide a URL of the external data
15 | source - static file or dynamically generated - and it will do the rest.
16 |
17 |
18 | ## Important notice
19 |
20 | Due to security measures implemented in most of the browsers, the external data
21 | loader will work only when the page with the chart or map is loaded via web
22 | server.
23 |
24 | So, any of the examples loaded locally (file:///) will not work.
25 |
26 | The page needs to be loaded via web server (http://) in order to work properly.
27 |
28 | Loading data from another domain than the web page is loaded is possible but is
29 | a subject for `Access-Control-Allow-Origin` policies defined by the web server
30 | you are loading data from.
31 |
32 | For more about loading data across domains use the following thread:
33 | http://stackoverflow.com/questions/1653308/access-control-allow-origin-multiple-origin-domains
34 |
35 |
36 | ## Usage
37 |
38 | ### 1) Include the minified version of file of this plugin. I.e.:
39 |
40 | ```
41 |
42 | ```
43 |
44 | (this needs to go after all the other amCharts includes)
45 |
46 | ### 2) Add data source properties to your chart configuration.
47 |
48 | Regular (Serial, Pie, etc.) charts:
49 |
50 | ```
51 | AmCharts.makeChart( "chartdiv", {
52 | ...,
53 | "dataLoader": {
54 | "url": "data.json",
55 | "format": "json"
56 | }
57 | } );
58 | ```
59 |
60 | Stock chart:
61 |
62 | ```
63 | AmCharts.makeChart( "chartdiv", {
64 | ...,
65 | "dataSets": [{
66 | ...,
67 | "dataLoader": {
68 | "url": "data.csv"
69 | "format": "csv",
70 | "delimiter": ",", // column separator
71 | "useColumnNames": true, // use first row for column names
72 | "skip": 1 // skip header row
73 | }
74 | }]
75 | } );
76 | ```
77 |
78 | That's it. The plugin will make sure the files are loaded and dataProvider is
79 | populated with their content *before* the chart is built.
80 |
81 | Some formats, like CSV, will require additional parameters needed to parse the
82 | data, such as "separator".
83 |
84 | If the "format" is omitted, the plugin will assume JSON.
85 |
86 |
87 | ## Complete list of available dataLoader settings
88 |
89 | Property | Default | Description
90 | -------- | ------- | -----------
91 | async | true | If set to false (not recommended) everything will wait until data is fully loaded
92 | delimiter | , | [CSV only] a delimiter for columns (use \t for tab delimiters)
93 | format | json | Type of data: json, csv
94 | noStyles | false | If set to true no styles will be applied to "Data loading" curtain
95 | postProcess | | If set to function reference, that function will be called to "post-process" loaded data before passing it on to chart
96 | showErrors | true | Show loading errors in a chart curtain
97 | showCurtain | true| Show curtain over the chart area when loading data
98 | reload | 0 | Reload data every X seconds
99 | reverse | false | [CSV only] add data points in revers order
100 | skip | 0 | [CSV only] skip X first rows in data (includes first row if useColumnNames is used)
101 | timestamp | false | Add current timestamp to data URLs (to avoid caching)
102 | useColumnNames | false | [CSV only] Use first row in data as column names when parsing
103 |
104 |
105 | ## Using in JavaScript Stock Chart
106 |
107 | In JavaScript Stock Chart it works exactly the same as in other chart types,
108 | with the exception that `dataLoader` is set as a property to the data set
109 | definition. I.e.:
110 |
111 | ```
112 | var chart = AmCharts.makeChart("chartdiv", {
113 | "type": "stock",
114 | ...
115 | "dataSets": [{
116 | "title": "MSFT",
117 | "fieldMappings": [{
118 | "fromField": "Open",
119 | "toField": "open"
120 | }, {
121 | "fromField": "High",
122 | "toField": "high"
123 | }, {
124 | "fromField": "Low",
125 | "toField": "low"
126 | }, {
127 | "fromField": "Close",
128 | "toField": "close"
129 | }, {
130 | "fromField": "Volume",
131 | "toField": "volume"
132 | }],
133 | "compared": false,
134 | "categoryField": "Date",
135 | "dataLoader": {
136 | "url": "data/MSFT.csv",
137 | "format": "csv",
138 | "showCurtain": true,
139 | "showErrors": true,
140 | "async": true,
141 | "reverse": true,
142 | "delimiter": ",",
143 | "useColumnNames": true
144 | }
145 | }
146 | }]
147 | });
148 | ```
149 |
150 | ### Can I also load event data the same way?
151 |
152 | Sure. You just add a `eventDataLoader` object to your data set. All the same
153 | settings apply.
154 |
155 |
156 | ## Translating into other languages
157 |
158 | Depending on configuration options the plugin will display a small number of
159 | text prompts, like 'Data loading...'.
160 |
161 | Plugin will try matching chart's `language` property and display text prompts in
162 | a corresponding language. For that the plugin needs to have the translations.
163 |
164 | Some of the plugin translations are in **lang** subdirectory. Simply include the
165 | one you need.
166 |
167 | If there is no translation to your language readily available, just grab en.js,
168 | copy it and translate.
169 |
170 | The structure is simple:
171 |
172 | ```
173 | 'The phrase in English': 'Translation'
174 | ```
175 |
176 | The phrase in English must be left intact.
177 |
178 | When you're done, you can include your language as a JavaScript file.
179 |
180 | P.S. send us your translation so we can include it for the benefits of other
181 | users. Thanks!
182 |
183 |
184 | ## Requirements
185 |
186 | This plugin requires at least 3.13 version of JavaScript Charts, JavaScript
187 | Stock Chart or JavaScript Maps.
188 |
189 |
190 | ## Demos
191 |
192 | They're all in subdirectory /examples.
193 |
194 |
195 | ## Extending this plugin
196 |
197 | You're encouraged to modify, extend and make derivative plugins out of this
198 | plugin.
199 |
200 | You can modify files, included in this archive or, better yet, fork this project
201 | on GitHub:
202 |
203 | https://github.com/amcharts/dataloader
204 |
205 | We're curious types. Please let us know (contact@amcharts.com) if you do create
206 | something new out of this plugin.
207 |
208 |
209 | ## License
210 |
211 | This plugin is licensed under Apache License 2.0.
212 |
213 | This basically means you're free to use or modify this plugin, even make your
214 | own versions or completely different products out of it.
215 |
216 | Please see attached file "license.txt" for the complete license or online here:
217 |
218 | http://www.apache.org/licenses/LICENSE-2.0
219 |
220 |
221 | ## Contact us
222 |
223 | * Email:contact@amcharts.com
224 | * Web: http://www.amcharts.com/
225 | * Facebook: https://www.facebook.com/amcharts
226 | * Twitter: https://twitter.com/amcharts
227 |
228 |
229 | ## Changelog
230 |
231 | ### 0.9.1
232 | * Fix chart animations not playing after asynchronous load
233 |
234 | ### 0.9
235 | * Initial release
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/funnel.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/gauge.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/images/bicycle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zachcr/react-amchart-basic/3bf57cd455252f1ba59382bdab43c7cee2856380/lib/amcharts/plugins/responsive/examples/images/bicycle.png
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/images/car.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zachcr/react-amchart-basic/3bf57cd455252f1ba59382bdab43c7cee2856380/lib/amcharts/plugins/responsive/examples/images/car.png
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/images/motorcycle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zachcr/react-amchart-basic/3bf57cd455252f1ba59382bdab43c7cee2856380/lib/amcharts/plugins/responsive/examples/images/motorcycle.png
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | amCharts Responsive Example
7 |
8 |
9 |
10 |
49 |
50 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
101 |
102 |
103 |
104 | 800x500px
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/map.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
12 |
19 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/pie1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/pie2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/radar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/serial1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/serial2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
12 |
19 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/serial3.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/stock.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
12 |
21 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
--------------------------------------------------------------------------------
/lib/amcharts/plugins/responsive/examples/xy.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | amCharts Responsive Example
8 |
9 |
10 |
11 |
18 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/lib/amcharts/radar.js:
--------------------------------------------------------------------------------
1 | AmCharts.AmRadarChart=AmCharts.Class({inherits:AmCharts.AmCoordinateChart,construct:function(a){this.type="radar";AmCharts.AmRadarChart.base.construct.call(this,a);this.cname="AmRadarChart";this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=0;this.radius="35%";AmCharts.applyTheme(this,a,this.cname)},initChart:function(){AmCharts.AmRadarChart.base.initChart.call(this);this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);this.drawChart()},updateData:function(){this.parseData();
2 | var a=this.graphs,b;for(b=0;bf&&(y="end",q-=10);180==f&&(u-=5);0===f&&(u+=5);f=AmCharts.text(b.container,r[t].category,p,h,m,y);f.translate(q+5,u);this.set.push(f);AmCharts.setCN(b,f,a.bcn+"title");f.getBBox()}}}}});AmCharts.RadItem=AmCharts.Class({construct:function(a,b,c,e,k,l,d,n){e=a.chart;void 0===c&&(c="");var g=a.chart.fontFamily,h=a.fontSize;void 0===h&&(h=a.chart.fontSize);var m=a.color;void 0===m&&(m=a.chart.color);var p=a.chart.container;this.set=k=p.set();var r=a.axisColor,B=a.axisAlpha,t=a.tickLength,f=a.gridAlpha,q=a.gridThickness,u=a.gridColor,y=a.dashLength,E=a.fillColor,C=a.fillAlpha,F=a.labelsEnabled;l=a.counter;var G=a.inside,H=a.gridType,v,K=a.labelOffset,z;b-=a.height;var x,A=a.x,I=a.y;d?
7 | (F=!0,void 0!=d.id&&(z=e.classNamePrefix+"-guide-"+d.id),isNaN(d.tickLength)||(t=d.tickLength),void 0!=d.lineColor&&(u=d.lineColor),isNaN(d.lineAlpha)||(f=d.lineAlpha),isNaN(d.dashLength)||(y=d.dashLength),isNaN(d.lineThickness)||(q=d.lineThickness),!0===d.inside&&(G=!0),void 0!==d.boldLabel&&(n=d.boldLabel)):c||(f/=3,t/=2);var J="end",D=-1;G&&(J="start",D=1);var w;F&&(w=AmCharts.text(p,c,m,g,h,J,n),w.translate(A+(t+3+K)*D,b),k.push(w),AmCharts.setCN(e,w,a.bcn+"label"),d&&AmCharts.setCN(e,w,"guide"),
8 | AmCharts.setCN(e,w,z,!0),this.label=w,x=AmCharts.line(p,[A,A+t*D],[b,b],r,B,q),k.push(x),AmCharts.setCN(e,x,a.bcn+"tick"),d&&AmCharts.setCN(e,x,"guide"),AmCharts.setCN(e,x,z,!0));b=Math.round(a.y-b);n=[];g=[];if(0e){var f=e;e=d;d=f}b.dispatchZoomEvent(d,e)}}}},zoomObjects:function(a){var c=a.length,b;for(b=0;be&&(e=h);hthis.maxZoomFactor&&(a=this.maxZoomFactor);return a},fitH:function(a,c){var b=-(this.plotAreaWidth*c-this.plotAreaWidth);a