1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-03-09 15:39:59 +00:00

add files to project

This commit is contained in:
janickiy 2020-02-05 06:34:26 +03:00
commit 5cac498444
3729 changed files with 836998 additions and 0 deletions

View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,108 @@
# amCharts Animate
Version: 1.1.2
## Description
Smoothly animates the `dataProvider`
It works with serial, pie, XY, funnel, and radar.
Here are some examples:
[Serial chart (line)](http://codepen.io/team/amcharts/pen/64673d1369cc47c0e6a970b071bafd03)
[Serial chart (column)](http://codepen.io/team/amcharts/pen/a5322d071a194d5975a4c68309724324)
[Pie chart](http://codepen.io/team/amcharts/pen/3ff9b206ce37111fa508156df38504bc)
[XY chart](http://codepen.io/team/amcharts/pen/9c9289a7b5f8b1d6d11441836e09cc81)
[Funnel chart](http://codepen.io/team/amcharts/pen/8fd8d025730b01939a2eb56b908488df)
[Radar chart](http://codepen.io/team/amcharts/pen/6ffb5e356b6015a6dcb6019d7b14d3f6)
## Installation
Include `animate.min.js` on your web page:
```
<script src="//www.amcharts.com/lib/3/plugins/animate/animate.min.js"></script>
```
## Usage
Rather than using `chart.validateData`, instead use `chart.animateData`:
```
chart.animateData(newData, { duration: 1000 });
```
It will now smoothly animate from the old data to the new data.
----
The first argument is the new `dataProvider` for the chart.
The second argument is an object that can contain the following options:
* `duration` is required: it is the number of milliseconds that the animation should play for.
* `complete` is optional: it is a function that is called when the animation completes.
----
The new `dataProvider` must be different from the old `dataProvider`
If you want to modify the existing `dataProvider`, you must create a deep copy:
```
// Creates a deep copy of the old dataProvider
var newDataProvider = JSON.parse(JSON.stringify(chart.dataProvider));
// Adds new data to the new dataProvider
newDataProvider.push({ category: "foo", value: 10 });
// Mutates the data in the new dataProvider
newDataProvider[0].value = 50;
// Animates with the new dataProvider
chart.animateData(newDataProvider, { duration: 1000 });
```
## License
All software included in this collection is licensed under Apache License 2.0.
This basically means you're free to use or modify it, even make your own
versions or completely different products out of them.
Please see attached file "license.txt" for the complete license or online here:
http://www.apache.org/licenses/LICENSE-2.0
## Contact us
* Email: contact@amcharts.com
* Web: http://www.amcharts.com/
* Facebook: https://www.facebook.com/amcharts
* Twitter: https://twitter.com/amcharts
## Changelog
### 1.1.2
* Fixing a bug with the minimum/maximum
### 1.1.1
* It now automatically sets the minimum/maximum on the value axes while animating
### 1.1.0
* Adding in support for XY charts
### 1.0.0
* Initial release

View file

@ -0,0 +1,583 @@
/*
Plugin Name: amCharts Animate
Description: Smoothly animates the `dataProvider`
Author: Paul Chapman, amCharts
Version: 1.1.2
Author URI: http://www.amcharts.com/
Copyright 2015 amCharts
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Please note that the above license covers only this plugin. It by all means does
not apply to any other amCharts products that are covered by different licenses.
*/
/* globals AmCharts */
/* jshint -W061 */
( function() {
"use strict";
// For older browsers, e.g. IE9 and lower
if ( typeof requestAnimationFrame === "undefined" ) {
var fps = 1000 / 60;
var raf = function( f ) {
setTimeout( function() {
f( new Date().getTime() );
}, fps );
};
} else {
var raf = requestAnimationFrame;
}
function tween( time, from, to ) {
return ( time * ( to - from ) ) + from;
}
function easeInOut3( t ) {
var r = ( t < 0.5 ? t * 2 : ( 1 - t ) * 2 );
r *= r * r * r;
return ( t < 0.5 ? r / 2 : 1 - ( r / 2 ) );
}
function easeIn3( t ) {
t *= t * t * t;
return t;
}
function easeOut3( t ) {
var r = ( 1 - t );
r *= r * r * r;
return ( 1 - r );
}
function Tween( object, key, from, to ) {
this._object = object;
this._key = key;
this._from = from;
this._to = to;
}
Tween.prototype.interpolate = function( time ) {
this._object[ this._key ] = tween( time, this._from, this._to );
};
function Animation( duration, easing, onComplete, tweens, chart ) {
this._finished = false;
this._startTime = null;
this._duration = duration;
this._easing = ( easing == null ? easeOut3 : easing );
this._onComplete = onComplete;
this._tweens = tweens;
this._chart = chart;
}
Animation.prototype.cancel = function() {
this._finished = true;
this._startTime = null;
this._duration = null;
this._easing = null;
this._onComplete = null;
this._tweens = null;
this._chart = null;
};
Animation.prototype._onFrame = function( now ) {
// This will only happen when the animation was cancelled
if ( this._finished ) {
return true;
} else if ( this._startTime === null ) {
this._startTime = now;
return false;
} else {
var diff = now - this._startTime;
if ( diff < this._duration ) {
this._tick( diff / this._duration );
return false;
} else {
this._end( 1 );
// Cleanup all the properties
this.cancel();
return true;
}
}
};
Animation.prototype._tick = function( time ) {
// Apply the easing to the time ratio
time = this._easing( time );
var tweens = this._tweens;
for ( var i = 0; i < tweens.length; ++i ) {
tweens[ i ].interpolate( time );
}
// TODO check the performance of this
pushNew( needsValidation, this._chart );
};
Animation.prototype._end = function( time ) {
this._tick( time );
this._onComplete();
};
function Animator() {
this._animating = false;
this._animations = [];
this._onBeforeFrames = [];
this._onAfterFrames = [];
var self = this;
this._raf = function( now ) {
self._onFrame( now );
};
}
Animator.prototype.animate = function( animation ) {
this._animations.push( animation );
if ( !this._animating ) {
this._animating = true;
raf( this._raf );
}
};
Animator.prototype.onBeforeFrame = function( f ) {
this._onBeforeFrames.push( f );
};
Animator.prototype.onAfterFrame = function( f ) {
this._onAfterFrames.push( f );
};
Animator.prototype._onFrame = function( now ) {
var onBeforeFrames = this._onBeforeFrames;
for ( var i = 0; i < onBeforeFrames.length; ++i ) {
onBeforeFrames[ i ]( now );
}
var animations = this._animations;
for ( var i = 0; i < animations.length; ++i ) {
var animation = animations[ i ];
// If the animation is finished...
if ( animation._onFrame( now ) ) {
// TODO this is a bit slow, but I don't know of a faster alternative
animations.splice( i, 1 );
--i;
}
}
var onAfterFrames = this._onAfterFrames;
for ( var i = 0; i < onAfterFrames.length; ++i ) {
onAfterFrames[ i ]( now );
}
// All animations are finished
if ( animations.length === 0 ) {
this._animating = false;
} else {
raf( this._raf );
}
};
var _animator = new Animator();
var needsValidation = [];
// This is more robust than the built-in `isNaN` function
function isNaN( x ) {
return x !== x;
}
function each( array, fn ) {
for ( var i = 0; i < array.length; ++i ) {
fn( array[ i ] );
}
}
function pushNew( array, x ) {
for ( var i = 0; i < array.length; ++i ) {
if ( array[ i ] === x ) {
return;
}
}
array.push( x );
}
// TODO check the performance of this
_animator.onAfterFrame( function() {
for ( var i = 0; i < needsValidation.length; ++i ) {
needsValidation[ i ].validateData();
}
needsValidation.length = 0;
} );
// This ensures that a key is only added once
function addKey( keys, seen, key ) {
if ( !seen[ key ] ) {
seen[ key ] = true;
keys.push( key );
}
}
function addKeys( keys, seen, object, a ) {
each( a, function( key ) {
var value = object[ key ];
if ( value != null ) {
addKey( keys, seen, value );
}
} );
}
function getKeysSliced( chart, keys, seen ) {
addKeys( keys, seen, chart, [
"alphaField",
"valueField"
] );
}
function getKeysFunnel( chart, keys, seen ) {
getKeysSliced( chart, keys, seen );
}
function getKeysPie( chart, keys, seen ) {
getKeysSliced( chart, keys, seen );
addKeys( keys, seen, chart, [
"labelRadiusField"
] );
}
function getKeysGraph( graph, keys, seen ) {
addKeys( keys, seen, graph, [
"alphaField",
"bulletSizeField",
"closeField",
"dashLengthField",
"errorField",
"highField",
"lowField",
"openField",
"valueField"
] );
}
function getKeysXY( graph, keys, seen ) {
getKeysGraph( graph, keys, seen );
addKeys( keys, seen, graph, [
"xField",
"yField"
] );
}
function getKeysGraphs( graphs, keys, seen, f ) {
each( graphs, function( graph ) {
f( graph, keys, seen );
} );
}
function getKeysCategoryAxis( categoryAxis, keys, seen ) {
addKeys( keys, seen, categoryAxis, [
"widthField"
] );
}
// Returns an array of all of the animatable keys
function getKeys( chart ) {
var keys = [];
var seen = {};
if ( chart.type === "funnel" ) {
getKeysFunnel( chart, keys, seen );
} else if ( chart.type === "pie" ) {
getKeysPie( chart, keys, seen );
} else if ( chart.type === "serial" ) {
getKeysCategoryAxis( chart.categoryAxis, keys, seen );
getKeysGraphs( chart.graphs, keys, seen, getKeysGraph );
} else if ( chart.type === "radar" ) {
getKeysGraphs( chart.graphs, keys, seen, getKeysGraph );
} else if ( chart.type === "xy" ) {
getKeysGraphs( chart.graphs, keys, seen, getKeysXY );
}
return keys;
}
// Sets the minimum/maximum of the value axes while the animation is playing
function setAxesMinMax( chart ) {
var axes = {};
if ( chart.type === "serial" || chart.type === "radar" || chart.type === "xy" ) {
each( chart.valueAxes, function( axis ) {
// TODO is it guaranteed that every value axis has an id ?
if ( axes[ axis.id ] == null ) {
// This saves the old minimum / maximum so that we can restore it after the animation is complete
axes[ axis.id ] = {
minimum: axis.minimum,
maximum: axis.maximum
};
var min = axis.minRR;
var max = axis.maxRR;
var dif = max - min;
var difE;
if ( dif === 0 ) {
difE = Math.pow( 10, Math.floor( Math.log( Math.abs( max ) ) * Math.LOG10E ) ) / 10;
} else {
difE = Math.pow( 10, Math.floor( Math.log( Math.abs( dif ) ) * Math.LOG10E ) ) / 10;
}
if ( axis.minimum == null ) {
axis.minimum = Math.floor( min / difE ) * difE - difE;
}
if ( axis.maximum == null ) {
axis.maximum = Math.ceil( max / difE ) * difE + difE;
}
}
} );
}
return axes;
}
// Resets the minimum/maximum of the value axes after the animation is finished
function resetAxesMinMax( chart, axes ) {
if ( chart.type === "serial" || chart.type === "radar" || chart.type === "xy" ) {
each( chart.valueAxes, function( axis ) {
var info = axes[ axis.id ];
if ( info != null ) {
if ( info.minimum == null ) {
delete axis.minimum;
}
if ( info.maximum == null ) {
delete axis.maximum;
}
}
} );
}
}
function getCategoryField( chart ) {
if ( chart.type === "funnel" || chart.type === "pie" ) {
return chart.titleField;
} else if ( chart.type === "serial" || chart.type === "radar" ) {
return chart.categoryField;
}
}
function getValue( object, key ) {
var value = object[ key ];
if ( value == null ) {
return null;
} else {
value = +value;
// TODO test this
// TODO what about Infinity, etc. ?
if ( isNaN( value ) ) {
return null;
} else {
return value;
}
}
}
function getCategory( object, key ) {
var value = object[ key ];
if ( value == null ) {
return null;
} else {
// TODO better algorithm for this ?
return "" + value;
}
}
function getCategories( dataProvider, categoryField ) {
var categories = {};
each( dataProvider, function( data ) {
var category = getCategory( data, categoryField );
if ( category != null ) {
categories[ category ] = data;
}
} );
return categories;
}
function getNormalTweens( dataProvider, categoryField, categories, keys ) {
var tweens = [];
each( dataProvider, function( newData ) {
var category = getCategory( newData, categoryField );
// If the new data has the same category as the old data...
if ( category != null && category in categories ) {
var oldData = categories[ category ];
each( keys, function( key ) {
var oldValue = getValue( oldData, key );
var newValue = getValue( newData, key );
// If the old field and new field both exist...
if ( oldValue != null && newValue != null ) {
tweens.push( new Tween( newData, key, oldValue, newValue ) );
}
} );
}
} );
return tweens;
}
function getXYTweens( oldDataProvider, newDataProvider, keys ) {
var tweens = [];
var length = Math.min( oldDataProvider.length, newDataProvider.length );
for ( var i = 0; i < length; ++i ) {
var oldData = oldDataProvider[ i ];
var newData = newDataProvider[ i ];
each( keys, function( key ) {
var oldValue = getValue( oldData, key );
var newValue = getValue( newData, key );
// If the old field and new field both exist...
if ( oldValue != null && newValue != null ) {
tweens.push( new Tween( newData, key, oldValue, newValue ) );
}
} );
}
return tweens;
}
function getTweens( chart, dataProvider ) {
if ( chart.type === "xy" ) {
var keys = getKeys( chart );
return getXYTweens( chart.dataProvider, dataProvider, keys );
} else {
var categoryField = getCategoryField( chart );
var keys = getKeys( chart );
var categories = getCategories( chart.dataProvider, categoryField );
return getNormalTweens( dataProvider, categoryField, categories, keys );
}
}
function animateData( dataProvider, options ) {
var chart = this;
var tweens = getTweens( chart, dataProvider );
var axes = setAxesMinMax( chart );
chart.dataProvider = dataProvider;
function onComplete() {
resetAxesMinMax( chart, axes );
if ( options.complete != null ) {
options.complete();
}
}
var animation = new Animation(
options.duration,
options.easing,
onComplete,
tweens,
chart
);
_animator.animate( animation );
return animation;
}
AmCharts.addInitHandler( function( chart ) {
chart.animateData = animateData;
}, [ "funnel", "pie", "serial", "radar", "xy" ] );
} )();

View file

@ -0,0 +1,40 @@
!function(){"use strict"
function t(t,n,i){return t*(i-n)+n}function n(t){var n=1-t
return n*=n*n*n,1-n}function i(t,n,i,e){this._object=t,this._key=n,this._from=i,this._to=e}function e(t,i,e,r,a){this._finished=!1,this._startTime=null,this._duration=t,this._easing=null==i?n:i,this._onComplete=e,this._tweens=r,this._chart=a}function r(){this._animating=!1,this._animations=[],this._onBeforeFrames=[],this._onAfterFrames=[]
var t=this
this._raf=function(n){t._onFrame(n)}}function a(t){return t!==t}function o(t,n){for(var i=0;i<t.length;++i)n(t[i])}function u(t,n){for(var i=0;i<t.length;++i)if(t[i]===n)return
t.push(n)}function l(t,n,i){n[i]||(n[i]=!0,t.push(i))}function s(t,n,i,e){o(e,function(e){var r=i[e]
null!=r&&l(t,n,r)})}function h(t,n,i){s(n,i,t,["alphaField","valueField"])}function f(t,n,i){h(t,n,i)}function m(t,n,i){h(t,n,i),s(n,i,t,["labelRadiusField"])}function c(t,n,i){s(n,i,t,["alphaField","bulletSizeField","closeField","dashLengthField","errorField","highField","lowField","openField","valueField"])}function p(t,n,i){c(t,n,i),s(n,i,t,["xField","yField"])}function _(t,n,i,e){o(t,function(t){e(t,n,i)})}function d(t,n,i){s(n,i,t,["widthField"])}function v(t){var n=[],i={}
return"funnel"===t.type?f(t,n,i):"pie"===t.type?m(t,n,i):"serial"===t.type?(d(t.categoryAxis,n,i),_(t.graphs,n,i,c)):"radar"===t.type?_(t.graphs,n,i,c):"xy"===t.type&&_(t.graphs,n,i,p),n}function y(t){var n={}
return("serial"===t.type||"radar"===t.type||"xy"===t.type)&&o(t.valueAxes,function(t){if(null==n[t.id]){n[t.id]={minimum:t.minimum,maximum:t.maximum}
var i,e=t.minRR,r=t.maxRR,a=r-e
i=0===a?Math.pow(10,Math.floor(Math.log(Math.abs(r))*Math.LOG10E))/10:Math.pow(10,Math.floor(Math.log(Math.abs(a))*Math.LOG10E))/10,null==t.minimum&&(t.minimum=Math.floor(e/i)*i-i),null==t.maximum&&(t.maximum=Math.ceil(r/i)*i+i)}}),n}function F(t,n){("serial"===t.type||"radar"===t.type||"xy"===t.type)&&o(t.valueAxes,function(t){var i=n[t.id]
null!=i&&(null==i.minimum&&delete t.minimum,null==i.maximum&&delete t.maximum)})}function g(t){return"funnel"===t.type||"pie"===t.type?t.titleField:"serial"===t.type||"radar"===t.type?t.categoryField:void 0}function x(t,n){var i=t[n]
return null==i?null:(i=+i,a(i)?null:i)}function M(t,n){var i=t[n]
return null==i?null:""+i}function w(t,n){var i={}
return o(t,function(t){var e=M(t,n)
null!=e&&(i[e]=t)}),i}function A(t,n,e,r){var a=[]
return o(t,function(t){var u=M(t,n)
if(null!=u&&u in e){var l=e[u]
o(r,function(n){var e=x(l,n),r=x(t,n)
null!=e&&null!=r&&a.push(new i(t,n,e,r))})}}),a}function T(t,n,e){for(var r=[],a=Math.min(t.length,n.length),u=0;a>u;++u){var l=t[u],s=n[u]
o(e,function(t){var n=x(l,t),e=x(s,t)
null!=n&&null!=e&&r.push(new i(s,t,n,e))})}return r}function b(t,n){if("xy"===t.type){var i=v(t)
return T(t.dataProvider,n,i)}var e=g(t),i=v(t),r=w(t.dataProvider,e)
return A(n,e,r,i)}function k(t,n){function i(){F(r,o),null!=n.complete&&n.complete()}var r=this,a=b(r,t),o=y(r)
r.dataProvider=t
var u=new e(n.duration,n.easing,i,a,r)
return C.animate(u),u}if("undefined"==typeof requestAnimationFrame)var R=1e3/60,B=function(t){setTimeout(function(){t((new Date).getTime())},R)}
else var B=requestAnimationFrame
i.prototype.interpolate=function(n){this._object[this._key]=t(n,this._from,this._to)},e.prototype.cancel=function(){this._finished=!0,this._startTime=null,this._duration=null,this._easing=null,this._onComplete=null,this._tweens=null,this._chart=null},e.prototype._onFrame=function(t){if(this._finished)return!0
if(null===this._startTime)return this._startTime=t,!1
var n=t-this._startTime
return n<this._duration?(this._tick(n/this._duration),!1):(this._end(1),this.cancel(),!0)},e.prototype._tick=function(t){t=this._easing(t)
for(var n=this._tweens,i=0;i<n.length;++i)n[i].interpolate(t)
u(D,this._chart)},e.prototype._end=function(t){this._tick(t),this._onComplete()},r.prototype.animate=function(t){this._animations.push(t),this._animating||(this._animating=!0,B(this._raf))},r.prototype.onBeforeFrame=function(t){this._onBeforeFrames.push(t)},r.prototype.onAfterFrame=function(t){this._onAfterFrames.push(t)},r.prototype._onFrame=function(t){for(var n=this._onBeforeFrames,i=0;i<n.length;++i)n[i](t)
for(var e=this._animations,i=0;i<e.length;++i){var r=e[i]
r._onFrame(t)&&(e.splice(i,1),--i)}for(var a=this._onAfterFrames,i=0;i<a.length;++i)a[i](t)
0===e.length?this._animating=!1:B(this._raf)}
var C=new r,D=[]
C.onAfterFrame(function(){for(var t=0;t<D.length;++t)D[t].validateData()
D.length=0}),AmCharts.addInitHandler(function(t){t.animateData=k},["funnel","pie","serial","radar","xy"])}()

View file

@ -0,0 +1,28 @@
{
"name": "amcharts3-animate",
"authors": [
"amCharts <contact@amcharts.com>"
],
"description": "amCharts V3 Animate plugin",
"main": [
"animate.js"
],
"keywords": [
"amcharts",
"charts",
"javascript",
"plugin"
],
"moduleType": [
"globals"
],
"dependencies": {
"amcharts3": ">= 3.11.1"
},
"license": "Apache-2.0",
"homepage": "https://www.amcharts.com/",
"repository": {
"type": "git",
"url": "git://github.com/amcharts/animate.git"
}
}

View file

@ -0,0 +1,78 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/funnel.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
<script src="../animate.min.js"></script>
<div id="chartdiv"></div>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "funnel",
"theme": "light",
"dataProvider": generateChartData(),
"valueField": "value",
"titleField": "category",
"alphaField": "alpha",
"startDuration": 0,
"precision": 2,
"neckHeight": 150,
"neckWidth": 200
});
function generateChartData() {
var chartData = [];
for ( var i = 0; i < 10; i++ ) {
var value = Math.floor(Math.random() * 100);
var labelRadius = Math.floor(Math.random() * 100);
var alpha = Math.random();
chartData.push( {
category: "" + i,
value: value,
labelRadius: labelRadius,
alpha: alpha
} );
}
return chartData;
}
function loop() {
var data = generateChartData();
chart.animateData(data, {
duration: 1000,
complete: function () {
setTimeout(loop, 2000);
}
});
}
chart.addListener("init", function () {
setTimeout(loop, 1000);
});
</script>
</body>
</html>

View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
<script src="../animate.min.js"></script>
<div id="chartdiv"></div>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",
"theme": "light",
"dataProvider": generateChartData(),
"valueField": "value",
"titleField": "category",
"labelRadiusField": "labelRadius",
"alphaField": "alpha",
"startDuration": 0
});
function generateChartData() {
var chartData = [];
for ( var i = 0; i < 10; i++ ) {
var value = Math.floor(Math.random() * 100);
var labelRadius = Math.floor(Math.random() * 100);
var alpha = Math.random();
chartData.push( {
category: "" + i,
value: value,
labelRadius: labelRadius,
alpha: alpha
} );
}
return chartData;
}
function loop() {
var data = generateChartData();
chart.animateData(data, {
duration: 1000,
complete: function () {
setTimeout(loop, 2000);
}
});
}
chart.addListener("init", function () {
setTimeout(loop, 1000);
});
</script>
</body>
</html>

View file

@ -0,0 +1,97 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/radar.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
<script src="../animate.min.js"></script>
<div id="chartdiv"></div>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "radar",
"theme": "light",
"dataProvider": generateChartData(),
"graphs": [{
"bullet": "round",
"bulletSizeField": "bullet1",
"lineThickness": 2,
"valueField": "value",
"type": "line",
"alphaField": "alpha1",
"dashLengthField": "dash1"
}, {
"bullet": "round",
"bulletSizeField": "bullet2",
"lineThickness": 2,
"valueField": "value2",
"type": "line",
"alphaField": "alpha2",
"dashLengthField": "dash2"
}],
"valueAxes": [{
"minimum": 0,
"maximum": 100
}],
"categoryField": "category"
});
function generateChartData() {
var chartData = [];
for ( var i = 0; i < 25; i++ ) {
var a = Math.floor( Math.random() * 100 );
var b = Math.floor( Math.random() * 100 );
chartData.push( {
category: "" + i,
value: a,
value2: b,
bullet1: Math.floor(Math.random() * 10),
bullet2: Math.floor(Math.random() * 10),
alpha1: (Math.random() < 0.5 ? 0 : 1),
alpha2: (Math.random() < 0.5 ? 0 : 1),
dash1: Math.floor(Math.random() * 20),
dash2: Math.floor(Math.random() * 20)
} );
}
return chartData;
}
function loop() {
var data = generateChartData();
chart.animateData(data, {
duration: 1000,
complete: function () {
setTimeout(loop, 2000);
}
});
}
chart.addListener("init", function () {
setTimeout(loop, 1000);
});
</script>
</body>
</html>

View file

@ -0,0 +1,99 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
<script src="../animate.min.js"></script>
<div id="chartdiv"></div>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"dataProvider": generateChartData(),
"graphs": [{
"valueField": "value",
"type": "column",
"fillAlphas": 1,
"alphaField": "alpha1"
}, {
"valueField": "value2",
"fillAlphas": 1,
"type": "column",
"alphaField": "alpha2"
}],
"valueAxes": [{
"minimum": 0,
"maximum": 400
}],
"chartCursor": {},
"categoryAxis": {
"parseDates": true,
"minPeriod": "mm"
},
"zoomOutOnDataUpdate": false,
"categoryField": "date"
});
function generateChartData() {
var chartData = [];
var firstDate = new Date( 2012, 0, 1 );
firstDate.setDate( firstDate.getDate() - 1000 );
firstDate.setHours( 0, Math.floor(Math.random() * 10), 0, 0 );
for ( var i = 0; i < 10; i++ ) {
var newDate = new Date( firstDate );
newDate.setHours( 0, i, 0, 0 );
var a = Math.round( Math.random() * ( 200 + i ) ) + 100 + i;
var b = Math.round( Math.random() * ( 200 + i ) ) + 100 + i;
chartData.push( {
date: newDate,
value: a,
value2: b,
alpha1: (Math.random() < 0.5 ? 0 : 1),
alpha2: (Math.random() < 0.5 ? 0 : 1)
} );
}
return chartData;
}
function loop() {
var data = generateChartData();
chart.animateData(data, {
duration: 1000,
complete: function () {
setTimeout(loop, 2000);
}
});
}
chart.addListener("init", function () {
setTimeout(loop, 1000);
});
</script>
</body>
</html>

View file

@ -0,0 +1,96 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
<script src="../animate.min.js"></script>
<div id="chartdiv"></div>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"dataProvider": generateChartData(),
"graphs": [{
"lineThickness": 2,
"valueField": "value",
"type": "smoothedLine"
}, {
"lineThickness": 2,
"valueField": "value2",
"type": "smoothedLine"
}],
"valueAxes": [{
"minimum": 0,
"maximum": 400
}],
"chartScrollbar": {},
"chartCursor": {},
"categoryAxis": {
"parseDates": true,
"minPeriod": "mm"
},
"zoomOutOnDataUpdate": false,
"categoryField": "date"
});
function generateChartData() {
var chartData = [];
var firstDate = new Date( 2012, 0, 1 );
firstDate.setDate( firstDate.getDate() - 1000 );
firstDate.setHours( 0, Math.floor(Math.random() * 10), 0, 0 );
for ( var i = 0; i < 100; i++ ) {
var newDate = new Date( firstDate );
newDate.setHours( 0, i, 0, 0 );
var a = Math.round( Math.random() * ( 40 + i ) ) + 100 + i;
var b = Math.round( Math.random() * ( 40 + i ) ) + 100 + i;
chartData.push( {
date: newDate,
value: a,
value2: b
} );
}
return chartData;
}
function loop() {
var data = generateChartData();
chart.animateData(data, {
duration: 1000,
complete: function () {
setTimeout(loop, 2000);
}
});
}
chart.addListener("init", function () {
setTimeout(loop, 1000);
});
</script>
</body>
</html>

View file

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/xy.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
<script src="../animate.js"></script>
<div id="chartdiv"></div>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "xy",
"theme": "light",
"dataProvider": generateChartData(),
"valueAxes": [{
"position": "left",
"minimum": 0,
"maximum": 100
}, {
"position": "bottom",
"minimum": 0,
"maximum": 100
}],
"graphs": [{
"bullet": "round",
"xField": "x",
"yField": "y",
"valueField": "value",
"alphaField": "alpha"
}]
});
function generateChartData() {
var chartData = [];
for ( var i = 0; i < 50; i++ ) {
chartData.push( {
x: Math.floor(Math.random() * 100),
y: Math.floor(Math.random() * 100),
value: Math.floor(Math.random() * 100),
alpha: Math.random()
} );
}
return chartData;
}
function loop() {
var data = generateChartData();
chart.animateData(data, {
duration: 1000,
complete: function () {
setTimeout(loop, 2000);
}
});
}
chart.addListener("init", function () {
setTimeout(loop, 1000);
});
</script>
</body>
</html>

View file

@ -0,0 +1,2 @@
require("amcharts3/amcharts/amcharts.js");
require("./animate.min.js");

View file

@ -0,0 +1,10 @@
{
"name": "amcharts3-animate",
"version": "1.1.2",
"license": "SEE LICENSE IN LICENSE",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/amcharts/animate.git"
}
}

View file

@ -0,0 +1,28 @@
{
"name": "amcharts3-dataloader",
"authors": [
"amCharts <contact@amcharts.com>"
],
"description": "amCharts V3 Data Loader plugin",
"main": [
"dataloader.js"
],
"keywords": [
"amcharts",
"charts",
"javascript",
"plugin"
],
"moduleType": [
"globals"
],
"dependencies": {
"amcharts3": ">= 3.11.1"
},
"license": "Apache-2.0",
"homepage": "https://www.amcharts.com/",
"repository": {
"type": "git",
"url": "git://github.com/amcharts/dataloader.git"
}
}

View file

@ -0,0 +1,744 @@
/*
Plugin Name: amCharts Data Loader
Description: This plugin adds external data loading capabilities to all amCharts libraries.
Author: Martynas Majeris, amCharts
Version: 1.0.16
Author URI: http://www.amcharts.com/
Copyright 2015 amCharts
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Please note that the above license covers only this plugin. It by all means does
not apply to any other amCharts products that are covered by different licenses.
*/
/**
* TODO:
* incremental load
* XML support (?)
*/
/* globals AmCharts, ActiveXObject */
/* jshint -W061 */
/**
* Initialize language prompt container
*/
AmCharts.translations.dataLoader = {};
/**
* Set init handler
*/
AmCharts.addInitHandler( function( chart ) {
/**
* Check if dataLoader is set (initialize it)
*/
if ( undefined === chart.dataLoader || !isObject( chart.dataLoader ) )
chart.dataLoader = {};
/**
* Check charts version for compatibility:
* the first compatible version is 3.13
*/
var version = chart.version.split( '.' );
if ( ( Number( version[ 0 ] ) < 3 ) || ( 3 === Number( version[ 0 ] ) && ( Number( version[ 1 ] ) < 13 ) ) )
return;
/**
* Define object reference for easy access
*/
var l = chart.dataLoader;
l.remaining = 0;
l.percentLoaded = {};
/**
* Set defaults
*/
var defaults = {
'async': true,
'format': 'json',
'showErrors': true,
'showCurtain': true,
'noStyles': false,
'reload': 0,
'timestamp': false,
'delimiter': ',',
'skip': 0,
'skipEmpty': true,
'emptyAs': undefined,
'useColumnNames': false,
'init': false,
'progress': false,
'reverse': false,
'reloading': false,
'complete': false,
'error': false,
'numberFields': [],
'headers': [],
'chart': chart
};
/**
* Create a function that can be used to load data (or reload via API)
*/
l.loadData = function() {
/**
* Load all files in a row
*/
if ( 'stock' === chart.type ) {
// delay this a little bit so the chart has the chance to build itself
setTimeout( function() {
// preserve animation
if ( 0 > chart.panelsSettings.startDuration ) {
l.startDuration = chart.panelsSettings.startDuration;
chart.panelsSettings.startDuration = 0;
}
// cycle through all of the data sets
for ( var x = 0; x < chart.dataSets.length; x++ ) {
var ds = chart.dataSets[ x ];
// load data
if ( undefined !== ds.dataLoader && undefined !== ds.dataLoader.url ) {
callFunction( ds.dataLoader.init, ds.dataLoader, chart );
ds.dataProvider = [];
applyDefaults( ds.dataLoader );
loadFile( ds.dataLoader.url, ds, ds.dataLoader, 'dataProvider' );
}
// load events data
if ( undefined !== ds.eventDataLoader && undefined !== ds.eventDataLoader.url ) {
callFunction( ds.eventDataLoader.init, ds.eventDataLoader, chart );
ds.events = [];
applyDefaults( ds.eventDataLoader );
loadFile( ds.eventDataLoader.url, ds, ds.eventDataLoader, 'stockEvents' );
}
}
}, 100 );
} else {
callFunction( l.init, l, chart );
applyDefaults( l );
if ( undefined === l.url )
return;
// preserve animation
if ( undefined !== chart.startDuration && ( 0 < chart.startDuration ) ) {
l.startDuration = chart.startDuration;
chart.startDuration = 0;
}
if ( 'gauge' === chart.type ) {
// set empty data set
if ( undefined === chart.arrows )
chart.arrows = [];
loadFile( l.url, chart, l, 'arrows' );
} else {
// set empty data set
if ( undefined === chart.dataProvider )
chart.dataProvider = chart.type === 'map' ? {} : [];
loadFile( l.url, chart, l, 'dataProvider' );
}
}
};
/**
* Trigger load
*/
l.loadData();
/**
* Loads a file and determines correct parsing mechanism for it
*/
function loadFile( url, holder, options, providerKey ) {
// set default providerKey
if ( undefined === providerKey )
providerKey = 'dataProvider';
// show curtain
if ( options.showCurtain )
showCurtain( undefined, options.noStyles );
// increment loader count
l.remaining++;
// set percent loaded for this file
l.percentLoaded[ url ] = 0;
// hijack user-defined "progress" handler with our own, so that we can
// track progress
if ( options.progress !== undefined && typeof( options.progress ) === 'function' && options._progress === undefined ) {
options._progress = options.progress;
options.progress = function( percent ) {
// set progress
l.percentLoaded[ url ] = percent;
// calculate global percent
var totalPercent = 0;
var fileCount = 0;
for ( var x in l.percentLoaded ) {
if ( l.percentLoaded.hasOwnProperty( x ) ) {
fileCount++;
totalPercent += l.percentLoaded[ x ];
}
}
var globalPercent = Math.round( ( totalPercent / fileCount ) * 100 ) / 100;
// call user function
options._progress.call( this, globalPercent, Math.round( percent * 100 ) / 100, url );
};
}
// load the file
AmCharts.loadFile( url, options, function( response ) {
// error?
if ( false === response ) {
callFunction( options.error, options, chart );
raiseError( AmCharts.__( 'Error loading the file', chart.language ) + ': ' + url, false, options );
} else {
// determine the format
if ( undefined === options.format ) {
// TODO
options.format = 'json';
}
// lowercase
options.format = options.format.toLowerCase();
// invoke parsing function
switch ( options.format ) {
case 'json':
holder[ providerKey ] = AmCharts.parseJSON( response );
if ( false === holder[ providerKey ] ) {
callFunction( options.error, options, chart );
raiseError( AmCharts.__( 'Error parsing JSON file', chart.language ) + ': ' + l.url, false, options );
holder[ providerKey ] = [];
return;
} else {
holder[ providerKey ] = postprocess( holder[ providerKey ], options );
callFunction( options.load, options, chart );
}
break;
case 'csv':
holder[ providerKey ] = AmCharts.parseCSV( response, options );
if ( false === holder[ providerKey ] ) {
callFunction( options.error, options, chart );
raiseError( AmCharts.__( 'Error parsing CSV file', chart.language ) + ': ' + l.url, false, options );
holder[ providerKey ] = [];
return;
} else {
holder[ providerKey ] = postprocess( holder[ providerKey ], options );
callFunction( options.load, options, chart );
}
break;
default:
callFunction( options.error, options, chart );
raiseError( AmCharts.__( 'Unsupported data format', chart.language ) + ': ' + options.format, false, options.noStyles );
return;
}
// decrement remaining counter
l.remaining--;
// we done?
if ( 0 === l.remaining ) {
// callback
callFunction( options.complete, chart );
// take in the new data
if ( options.async ) {
if ( 'map' === chart.type ) {
// take in new data
chart.validateNow( true );
// remove curtain
removeCurtain();
} else {
// add a dataUpdated event to handle post-load stuff
if ( 'gauge' !== chart.type ) {
chart.addListener( 'dataUpdated', function( event ) {
// restore default period (stock chart)
if ( 'stock' === chart.type && !options.reloading && undefined !== chart.periodSelector ) {
chart.periodSelector.setDefaultPeriod();
}
// remove curtain
removeCurtain();
// remove this listener
chart.events.dataUpdated.pop();
} );
}
// take in new data
chart.validateData();
// invalidate size for the pie chart
// disabled for now as it is not longer necessary
/*if ( 'pie' === chart.type && chart.invalidateSize !== undefined )
chart.invalidateSize();*/
// gauge chart does not trigger dataUpdated event
// let's explicitly remove the curtain for it
if ( 'gauge' === chart.type )
removeCurtain();
// make the chart animate again
if ( l.startDuration ) {
if ( 'stock' === chart.type ) {
chart.panelsSettings.startDuration = l.startDuration;
for ( var x = 0; x < chart.panels.length; x++ ) {
chart.panels[ x ].startDuration = l.startDuration;
chart.panels[ x ].animateAgain();
}
} else {
chart.startDuration = l.startDuration;
if ( chart.animateAgain !== undefined )
chart.animateAgain();
}
}
}
}
}
// schedule another load if necessary
if ( options.reload ) {
if ( options.timeout )
clearTimeout( options.timeout );
options.timeout = setTimeout( loadFile, 1000 * options.reload, url, holder, options, providerKey );
options.reloading = true;
}
}
} );
}
/**
* Checks if postProcess is set and invokes the handler
*/
function postprocess( data, options ) {
if ( undefined !== options.postProcess && isFunction( options.postProcess ) )
try {
return options.postProcess.call( l, data, options, chart );
} catch ( e ) {
raiseError( AmCharts.__( 'Error loading file', chart.language ) + ': ' + options.url, false, options );
return data;
} else
return data;
}
/**
* Returns true if argument is array
*/
function isObject( obj ) {
return 'object' === typeof( obj );
}
/**
* Returns true is argument is a function
*/
function isFunction( obj ) {
return 'function' === typeof( obj );
}
/**
* Applies defaults to config object
*/
function applyDefaults( obj ) {
for ( var x in defaults ) {
if ( defaults.hasOwnProperty( x ) )
setDefault( obj, x, defaults[ x ] );
}
}
/**
* Checks if object property is set, sets with a default if it isn't
*/
function setDefault( obj, key, value ) {
if ( undefined === obj[ key ] )
obj[ key ] = value;
}
/**
* Raises an internal error (writes it out to console)
*/
function raiseError( msg, error, options ) {
if ( options.showErrors )
showCurtain( msg, options.noStyles );
else {
removeCurtain();
console.log( msg );
}
}
/**
* Shows curtain over chart area
*/
function showCurtain( msg, noStyles ) {
// remove previous curtain if there is one
removeCurtain();
// did we pass in the message?
if ( undefined === msg )
msg = AmCharts.__( 'Loading data...', chart.language );
// create and populate curtain element
var curtain = document.createElement( 'div' );
curtain.setAttribute( 'id', chart.div.id + '-curtain' );
curtain.className = 'amcharts-dataloader-curtain';
if ( true !== noStyles ) {
curtain.style.position = 'absolute';
curtain.style.top = 0;
curtain.style.left = 0;
curtain.style.width = ( undefined !== chart.realWidth ? chart.realWidth : chart.divRealWidth ) + 'px';
curtain.style.height = ( undefined !== chart.realHeight ? chart.realHeight : chart.divRealHeight ) + 'px';
curtain.style.textAlign = 'center';
curtain.style.display = 'table';
curtain.style.fontSize = '20px';
try {
curtain.style.background = 'rgba(255, 255, 255, 0.3)';
} catch ( e ) {
curtain.style.background = 'rgb(255, 255, 255)';
}
curtain.innerHTML = '<div style="display: table-cell; vertical-align: middle;">' + msg + '</div>';
} else {
curtain.innerHTML = msg;
}
chart.containerDiv.appendChild( curtain );
l.curtain = curtain;
}
/**
* Removes the curtain
*/
function removeCurtain() {
try {
if ( undefined !== l.curtain )
chart.containerDiv.removeChild( l.curtain );
} catch ( e ) {
// do nothing
}
l.curtain = undefined;
}
/**
* Execute callback function
*/
function callFunction( func, param1, param2, param3 ) {
if ( 'function' === typeof func )
func.call( l, param1, param2, param3 );
}
}, [ 'pie', 'serial', 'xy', 'funnel', 'radar', 'gauge', 'gantt', 'stock', 'map' ] );
/**
* Returns prompt in a chart language (set by chart.language) if it is
* available
*/
if ( undefined === AmCharts.__ ) {
AmCharts.__ = function( msg, language ) {
if ( undefined !== language && undefined !== AmCharts.translations.dataLoader[ language ] && undefined !== AmCharts.translations.dataLoader[ language ][ msg ] )
return AmCharts.translations.dataLoader[ language ][ msg ];
else
return msg;
};
}
/**
* Loads a file from url and calls function handler with the result
*/
AmCharts.loadFile = function( url, options, handler ) {
// prepopulate options with minimal defaults if necessary
if ( typeof( options ) !== 'object' )
options = {};
if ( options.async === undefined )
options.async = true;
// create the request
var request;
if ( window.XMLHttpRequest ) {
// IE7+, Firefox, Chrome, Opera, Safari
request = new XMLHttpRequest();
} else {
// code for IE6, IE5
request = new ActiveXObject( 'Microsoft.XMLHTTP' );
}
// open the connection
try {
request.open( 'GET', options.timestamp ? AmCharts.timestampUrl( url ) : url, options.async );
} catch ( e ) {
handler.call( this, false );
}
// add headers?
if ( options.headers !== undefined && options.headers.length ) {
for ( var i = 0; i < options.headers.length; i++ ) {
var header = options.headers[ i ];
request.setRequestHeader( header.key, header.value );
}
}
// add onprogress handlers
if ( options.progress !== undefined && typeof( options.progress ) === 'function' ) {
request.onprogress = function( e ) {
var complete = ( e.loaded / e.total ) * 100;
options.progress.call( this, complete );
}
}
// set handler for data if async loading
request.onreadystatechange = function() {
if ( 4 === request.readyState && 404 === request.status )
handler.call( this, false );
else if ( 4 === request.readyState && 200 === request.status )
handler.call( this, request.responseText );
};
// load the file
try {
request.send();
} catch ( e ) {
handler.call( this, false );
}
};
/**
* Parses JSON string into an object
*/
AmCharts.parseJSON = function( response ) {
try {
if ( undefined !== JSON )
return JSON.parse( response );
else
return eval( response );
} catch ( e ) {
return false;
}
};
/**
* Prases CSV string into an object
*/
AmCharts.parseCSV = function( response, options ) {
// parse CSV into array
var data = AmCharts.CSVToArray( response, options.delimiter );
// do we need to cast some fields to numbers?
var numbers = options.numberFields && ( options.numberFields.length > 0 );
// init resuling array
var res = [];
var cols = [];
var col, i;
// first row holds column names?
if ( options.useColumnNames ) {
cols = data.shift();
// normalize column names
for ( var x = 0; x < cols.length; x++ ) {
// trim
col = cols[ x ].replace( /^\s+|\s+$/gm, '' );
// check for empty
if ( '' === col )
col = 'col' + x;
cols[ x ] = col;
}
if ( 0 < options.skip )
options.skip--;
}
// skip rows
for ( i = 0; i < options.skip; i++ )
data.shift();
// iterate through the result set
var row;
while ( ( row = options.reverse ? data.pop() : data.shift() ) ) {
if ( options.skipEmpty && row.length === 1 && row[ 0 ] === '' )
continue;
var dataPoint = {};
for ( i = 0; i < row.length; i++ ) {
col = undefined === cols[ i ] ? 'col' + i : cols[ i ];
dataPoint[ col ] = row[ i ] === "" ? options.emptyAs : row[ i ];
// check if we need to cast to integer
if ( numbers && options.numberFields.indexOf( col ) !== -1 )
dataPoint[ col ] = Number( dataPoint[ col ] );
}
res.push( dataPoint );
}
return res;
};
/**
* Parses CSV data into array
* Taken from here: (thanks!)
* http://www.bennadel.com/blog/1504-ask-ben-parsing-csv-strings-with-javascript-exec-regular-expression-command.htm
*/
AmCharts.CSVToArray = function( strData, strDelimiter ) {
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = ( strDelimiter || ',' );
// Create a regular expression to parse the CSV values.
var objPattern = new RegExp(
(
// Delimiters.
"(\\" + strDelimiter + "|\\r?\\n|\\r|^)" +
// Quoted fields.
"(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|" +
// Standard fields.
"([^\"\\" + strDelimiter + "\\r\\n]*))"
),
"gi"
);
// Create an array to hold our data. Give the array
// a default empty first row.
var arrData = [
[]
];
// Create an array to hold our individual pattern
// matching groups.
var arrMatches = null;
// Keep looping over the regular expression matches
// until we can no longer find a match.
while ( ( arrMatches = objPattern.exec( strData ) ) ) {
// Get the delimiter that was found.
var strMatchedDelimiter = arrMatches[ 1 ];
// Check to see if the given delimiter has a length
// (is not the start of string) and if it matches
// field delimiter. If id does not, then we know
// that this delimiter is a row delimiter.
if (
strMatchedDelimiter.length &&
( strMatchedDelimiter !== strDelimiter )
) {
// Since we have reached a new row of data,
// add an empty row to our data array.
arrData.push( [] );
}
// Now that we have our delimiter out of the way,
// let's check to see which kind of value we
// captured (quoted or unquoted).
var strMatchedValue;
if ( arrMatches[ 2 ] ) {
// We found a quoted value. When we capture
// this value, unescape any double quotes.
strMatchedValue = arrMatches[ 2 ].replace(
new RegExp( "\"\"", "g" ),
"\""
);
} else {
// We found a non-quoted value.
strMatchedValue = arrMatches[ 3 ];
}
// Now that we have our value string, let's add
// it to the data array.
arrData[ arrData.length - 1 ].push( strMatchedValue );
}
// Return the parsed data.
return ( arrData );
};
/**
* Appends timestamp to the url
*/
AmCharts.timestampUrl = function( url ) {
var p = url.split( '?' );
if ( 1 === p.length )
p[ 1 ] = new Date().getTime();
else
p[ 1 ] += '&' + new Date().getTime();
return p.join( '?' );
};

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,56 @@
Date,Type,Title,Description
2014-06-05,A,Analyst opinion change,Upgrade by FBR Capital from Mkt Perform to Outperform
2014-05-13,D,Dividend,Amount: 0.28
2014-02-18,D,Dividend,Amount: 0.28
2014-01-23,A,Analyst opinion change,Upgrade from Deutsche Bank from Hold to Buy
2014-01-10,A,Analyst opinion change,Upgrade from Barclays from Equal weight to Overweight
2013-11-19,D,Dividend,Amount: 0.28
2013-08-13,D,Dividend,Amount: 0.28
2013-08-13,A,Analyst opinion change,Downgrade from Stifel from Buy to Hold
2013-05-14,D,Dividend,Amount: 0.23
2013-04-30,A,Analyst opinion change,Downgrade from Standpoint Research from Buy to Hold
2013-02-19,D,Dividend,Amount: 0.23
2013-01-04,A,Analyst opinion change,Downgrade from Argus from Buy to Hold
2012-12-14,A,Analyst opinion change,Initiated by BMO Capital Markets
2012-12-12,A,Analyst opinion change,Upgrade from Standpoint Research from Hold to Buy
2012-11-13,D,Dividend,Amount: 0.23
2012-08-20,A,Analyst opinion change,Initiated by Longbow
2012-08-14,D,Dividend,Amount: 0.20
2012-07-20,A,Analyst opinion change,Initiated by Griffin Securities
2012-05-15,D,Dividend,Amount: 0.20
2012-04-20,A,Analyst opinion change,Initiated by MKM Partners
2012-03-16,A,Analyst opinion change,Upgrade from Argus from Hold to Buy
2012-02-14,D,Dividend,Amount: 0.20
2011-12-06,A,Analyst opinion change,Initiated by Barclays Capital
2011-11-15,D,Dividend,Amount: 0.20
2011-09-09,A,Analyst opinion change,Downgrade from Standpoint Research from Buy to Hold
2011-08-16,D,Dividend,Amount: 0.16
2011-05-17,D,Dividend,Amount: 0.16
2011-02-17,A,Analyst opinion change,Initiated by Collins Stewart
2011-02-15,D,Dividend,Amount: 0.16
2011-01-07,A,Analyst opinion change,Downgrade from Standpoint Research from Buy to Hold
2010-11-16,D,Dividend,Amount: 0.16
2010-10-25,A,Analyst opinion change,Downgrade by FBR Capital from Outperform to Mkt Perform
2010-09-13,A,Analyst opinion change,Initiated by Standpoint Research
2010-08-17,D,Dividend,Amount: 0.13
2010-07-23,A,Analyst opinion change,Upgrade from Benchmark Company from Sell to Hold
2010-05-27,A,Analyst opinion change,Upgrade by FBR Capital from Mkt Perform to Outperform
2010-05-18,D,Dividend,Amount: 0.13
2010-04-16,A,Analyst opinion change,Initiated by Janney Mntgmy Scott
2010-04-08,A,Analyst opinion change,Initiated by Soleil
2010-02-17,A,Analyst opinion change,Initiated Citigroup
2010-02-16,D,Dividend,Amount: 0.13
2009-11-17,D,Dividend,Amount: 0.13
2009-11-13,A,Analyst opinion change,Initiated UBS
2009-10-27,A,Analyst opinion change,Upgrade from Argus from Sell to Hold
2009-09-14,A,Analyst opinion change,Upgrade from Auriga U.S.A from Hold to Buy
2009-08-18,D,Dividend,Amount: 0.13
2009-08-18,A,Analyst opinion change,Upgrade from AmTech Research from Neutral to Buy
2009-07-24,A,Analyst opinion change,Downgrade by FBR Capital from Outperform to Mkt Perform
2009-05-19,D,Dividend,Amount: 0.13
2009-04-13,A,Analyst opinion change,Initiated AmTech Research
2009-04-07,A,Analyst opinion change,Upgrade from RBC Capital Mkts from Sector Perform to Outperform
2009-03-31,A,Analyst opinion change,Upgrade from Davenport from Neutral to Buy
2009-03-27,A,Analyst opinion change,Initiated Auriga U.S.A
2009-02-17,D,Dividend,Amount: 0.13
2009-01-23,A,Analyst opinion change,Downgrade from Davenport from Buy to Neutral
1 Date Type Title Description
2 2014-06-05 A Analyst opinion change Upgrade by FBR Capital from Mkt Perform to Outperform
3 2014-05-13 D Dividend Amount: 0.28
4 2014-02-18 D Dividend Amount: 0.28
5 2014-01-23 A Analyst opinion change Upgrade from Deutsche Bank from Hold to Buy
6 2014-01-10 A Analyst opinion change Upgrade from Barclays from Equal weight to Overweight
7 2013-11-19 D Dividend Amount: 0.28
8 2013-08-13 D Dividend Amount: 0.28
9 2013-08-13 A Analyst opinion change Downgrade from Stifel from Buy to Hold
10 2013-05-14 D Dividend Amount: 0.23
11 2013-04-30 A Analyst opinion change Downgrade from Standpoint Research from Buy to Hold
12 2013-02-19 D Dividend Amount: 0.23
13 2013-01-04 A Analyst opinion change Downgrade from Argus from Buy to Hold
14 2012-12-14 A Analyst opinion change Initiated by BMO Capital Markets
15 2012-12-12 A Analyst opinion change Upgrade from Standpoint Research from Hold to Buy
16 2012-11-13 D Dividend Amount: 0.23
17 2012-08-20 A Analyst opinion change Initiated by Longbow
18 2012-08-14 D Dividend Amount: 0.20
19 2012-07-20 A Analyst opinion change Initiated by Griffin Securities
20 2012-05-15 D Dividend Amount: 0.20
21 2012-04-20 A Analyst opinion change Initiated by MKM Partners
22 2012-03-16 A Analyst opinion change Upgrade from Argus from Hold to Buy
23 2012-02-14 D Dividend Amount: 0.20
24 2011-12-06 A Analyst opinion change Initiated by Barclays Capital
25 2011-11-15 D Dividend Amount: 0.20
26 2011-09-09 A Analyst opinion change Downgrade from Standpoint Research from Buy to Hold
27 2011-08-16 D Dividend Amount: 0.16
28 2011-05-17 D Dividend Amount: 0.16
29 2011-02-17 A Analyst opinion change Initiated by Collins Stewart
30 2011-02-15 D Dividend Amount: 0.16
31 2011-01-07 A Analyst opinion change Downgrade from Standpoint Research from Buy to Hold
32 2010-11-16 D Dividend Amount: 0.16
33 2010-10-25 A Analyst opinion change Downgrade by FBR Capital from Outperform to Mkt Perform
34 2010-09-13 A Analyst opinion change Initiated by Standpoint Research
35 2010-08-17 D Dividend Amount: 0.13
36 2010-07-23 A Analyst opinion change Upgrade from Benchmark Company from Sell to Hold
37 2010-05-27 A Analyst opinion change Upgrade by FBR Capital from Mkt Perform to Outperform
38 2010-05-18 D Dividend Amount: 0.13
39 2010-04-16 A Analyst opinion change Initiated by Janney Mntgmy Scott
40 2010-04-08 A Analyst opinion change Initiated by Soleil
41 2010-02-17 A Analyst opinion change Initiated Citigroup
42 2010-02-16 D Dividend Amount: 0.13
43 2009-11-17 D Dividend Amount: 0.13
44 2009-11-13 A Analyst opinion change Initiated UBS
45 2009-10-27 A Analyst opinion change Upgrade from Argus from Sell to Hold
46 2009-09-14 A Analyst opinion change Upgrade from Auriga U.S.A from Hold to Buy
47 2009-08-18 D Dividend Amount: 0.13
48 2009-08-18 A Analyst opinion change Upgrade from AmTech Research from Neutral to Buy
49 2009-07-24 A Analyst opinion change Downgrade by FBR Capital from Outperform to Mkt Perform
50 2009-05-19 D Dividend Amount: 0.13
51 2009-04-13 A Analyst opinion change Initiated AmTech Research
52 2009-04-07 A Analyst opinion change Upgrade from RBC Capital Mkts from Sector Perform to Outperform
53 2009-03-31 A Analyst opinion change Upgrade from Davenport from Neutral to Buy
54 2009-03-27 A Analyst opinion change Initiated Auriga U.S.A
55 2009-02-17 D Dividend Amount: 0.13
56 2009-01-23 A Analyst opinion change Downgrade from Davenport from Buy to Neutral

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,237 @@
[ {
"category": "John",
"segments": [ {
"start": 7,
"duration": 2,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 2,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Smith",
"segments": [ {
"start": 10,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 1,
"color": "#CF794A",
"task": "Task #3"
}, {
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
} ]
}, {
"category": "Ben",
"segments": [ {
"start": 12,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 16,
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Mike",
"segments": [ {
"start": 9,
"duration": 6,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 4,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Lenny",
"segments": [ {
"start": 8,
"duration": 1,
"color": "#CF794A",
"task": "Task #3"
}, {
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
} ]
}, {
"category": "Scott",
"segments": [ {
"start": 15,
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Julia",
"segments": [ {
"start": 9,
"duration": 2,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 1,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 8,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Bob",
"segments": [ {
"start": 9,
"duration": 8,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 7,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Kendra",
"segments": [ {
"start": 11,
"duration": 8,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 16,
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Tom",
"segments": [ {
"start": 9,
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 5,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Kyle",
"segments": [ {
"start": 6,
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Anita",
"segments": [ {
"start": 12,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 16,
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Jack",
"segments": [ {
"start": 8,
"duration": 10,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Kim",
"segments": [ {
"start": 12,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 3,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Aaron",
"segments": [ {
"start": 18,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Alan",
"segments": [ {
"start": 17,
"duration": 2,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 2,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Ruth",
"segments": [ {
"start": 13,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 1,
"color": "#CF794A",
"task": "Task #3"
}, {
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
} ]
}, {
"category": "Simon",
"segments": [ {
"start": 10,
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 17,
"duration": 4,
"color": "#FFE4C4",
"task": "Task #4"
} ]
} ]

View file

@ -0,0 +1,25 @@
[ {
"innerRadius": 70,
"nailRadius": 0,
"radius": "80%",
"startWidth": 10,
"endWidth": 10,
"value": 4
}, {
"innerRadius": 70,
"nailRadius": 0,
"radius": "100%",
"startWidth": 6,
"endWidth": 6,
"value": 8
}, {
"axis": "axis2",
"color": "#CC0000",
"innerRadius": 50,
"nailRadius": 0,
"radius": "100%",
"startWidth": 6,
"endWidth": 6,
"alpha": 1,
"value": 11
} ]

View file

@ -0,0 +1,155 @@
{
"map": "usaLow",
"areas": [{
"id": "US-AL",
"value": 4447100
}, {
"id": "US-AK",
"value": 626932
}, {
"id": "US-AZ",
"value": 5130632
}, {
"id": "US-AR",
"value": 2673400
}, {
"id": "US-CA",
"value": 33871648
}, {
"id": "US-CO",
"value": 4301261
}, {
"id": "US-CT",
"value": 3405565
}, {
"id": "US-DE",
"value": 783600
}, {
"id": "US-FL",
"value": 15982378
}, {
"id": "US-GA",
"value": 8186453
}, {
"id": "US-HI",
"value": 1211537
}, {
"id": "US-ID",
"value": 1293953
}, {
"id": "US-IL",
"value": 12419293
}, {
"id": "US-IN",
"value": 6080485
}, {
"id": "US-IA",
"value": 2926324
}, {
"id": "US-KS",
"value": 2688418
}, {
"id": "US-KY",
"value": 4041769
}, {
"id": "US-LA",
"value": 4468976
}, {
"id": "US-ME",
"value": 1274923
}, {
"id": "US-MD",
"value": 5296486
}, {
"id": "US-MA",
"value": 6349097
}, {
"id": "US-MI",
"value": 9938444
}, {
"id": "US-MN",
"value": 4919479
}, {
"id": "US-MS",
"value": 2844658
}, {
"id": "US-MO",
"value": 5595211
}, {
"id": "US-MT",
"value": 902195
}, {
"id": "US-NE",
"value": 1711263
}, {
"id": "US-NV",
"value": 1998257
}, {
"id": "US-NH",
"value": 1235786
}, {
"id": "US-NJ",
"value": 8414350
}, {
"id": "US-NM",
"value": 1819046
}, {
"id": "US-NY",
"value": 18976457
}, {
"id": "US-NC",
"value": 8049313
}, {
"id": "US-ND",
"value": 642200
}, {
"id": "US-OH",
"value": 11353140
}, {
"id": "US-OK",
"value": 3450654
}, {
"id": "US-OR",
"value": 3421399
}, {
"id": "US-PA",
"value": 12281054
}, {
"id": "US-RI",
"value": 1048319
}, {
"id": "US-SC",
"value": 4012012
}, {
"id": "US-SD",
"value": 754844
}, {
"id": "US-TN",
"value": 5689283
}, {
"id": "US-TX",
"value": 20851820,
"description": "<p>Texas 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).</p>"
}, {
"id": "US-UT",
"value": 2233169
}, {
"id": "US-VT",
"value": 608827
}, {
"id": "US-VA",
"value": 7078515
}, {
"id": "US-WA",
"value": 5894121
}, {
"id": "US-WV",
"value": 1808344
}, {
"id": "US-WI",
"value": 5363675
}, {
"id": "US-WY",
"value": 493782
}]
}

View file

@ -0,0 +1,152 @@
[ {
"id": "US-AL",
"value": 4447100
}, {
"id": "US-AK",
"value": 626932
}, {
"id": "US-AZ",
"value": 5130632
}, {
"id": "US-AR",
"value": 2673400
}, {
"id": "US-CA",
"value": 33871648
}, {
"id": "US-CO",
"value": 4301261
}, {
"id": "US-CT",
"value": 3405565
}, {
"id": "US-DE",
"value": 783600
}, {
"id": "US-FL",
"value": 15982378
}, {
"id": "US-GA",
"value": 8186453
}, {
"id": "US-HI",
"value": 1211537
}, {
"id": "US-ID",
"value": 1293953
}, {
"id": "US-IL",
"value": 12419293
}, {
"id": "US-IN",
"value": 6080485
}, {
"id": "US-IA",
"value": 2926324
}, {
"id": "US-KS",
"value": 2688418
}, {
"id": "US-KY",
"value": 4041769
}, {
"id": "US-LA",
"value": 4468976
}, {
"id": "US-ME",
"value": 1274923
}, {
"id": "US-MD",
"value": 5296486
}, {
"id": "US-MA",
"value": 6349097
}, {
"id": "US-MI",
"value": 9938444
}, {
"id": "US-MN",
"value": 4919479
}, {
"id": "US-MS",
"value": 2844658
}, {
"id": "US-MO",
"value": 5595211
}, {
"id": "US-MT",
"value": 902195
}, {
"id": "US-NE",
"value": 1711263
}, {
"id": "US-NV",
"value": 1998257
}, {
"id": "US-NH",
"value": 1235786
}, {
"id": "US-NJ",
"value": 8414350
}, {
"id": "US-NM",
"value": 1819046
}, {
"id": "US-NY",
"value": 18976457
}, {
"id": "US-NC",
"value": 8049313
}, {
"id": "US-ND",
"value": 642200
}, {
"id": "US-OH",
"value": 11353140
}, {
"id": "US-OK",
"value": 3450654
}, {
"id": "US-OR",
"value": 3421399
}, {
"id": "US-PA",
"value": 12281054
}, {
"id": "US-RI",
"value": 1048319
}, {
"id": "US-SC",
"value": 4012012
}, {
"id": "US-SD",
"value": 754844
}, {
"id": "US-TN",
"value": 5689283
}, {
"id": "US-TX",
"value": 20851820,
"description": "<p>Texas 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).</p>"
}, {
"id": "US-UT",
"value": 2233169
}, {
"id": "US-VT",
"value": 608827
}, {
"id": "US-VA",
"value": 7078515
}, {
"id": "US-WA",
"value": 5894121
}, {
"id": "US-WV",
"value": 1808344
}, {
"id": "US-WI",
"value": 5363675
}, {
"id": "US-WY",
"value": 493782
} ]

View file

@ -0,0 +1,8 @@
country,litres
"Czech Republic",156.9
"Ireland",131.1
"Germany",115.8
"Australia",109.9
"Austria",108.3
"UK",65
"Belgium",50
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

View file

@ -0,0 +1,22 @@
[{
"country": "Czech Republic",
"litres": 156.9
}, {
"country": "Ireland",
"litres": 131.1
}, {
"country": "Germany",
"litres": 115.8
}, {
"country": "Australia",
"litres": 109.9
}, {
"country": "Austria",
"litres": 108.3
}, {
"country": "UK",
"litres": 65
}, {
"country": "Belgium",
"litres": 50
}]

View file

@ -0,0 +1,20 @@
year,cars,motorcycles,bicycles
2000,1587,650,121
1995,1567,683,146
1996,1617,691,138
1997,1630,642,127
1998,1660,699,105
1999,1683,721,109
2000,1691,737,112
2001,1298,680,101
2002,1275,664,97
2003,1246,648,93
2004,1218,637,101
2005,1213,633,87
2006,1199,621,79
2007,1110,210,81
2008,1165,232,75
2009,1145,219,88
2010,1163,201,82
2011,1180,285,87
2012,1159,277,71
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

View file

@ -0,0 +1,96 @@
[{
"year": 2000,
"cars": 1587,
"motorcycles": 650,
"bicycles": 121
}, {
"year": 1995,
"cars": 1567,
"motorcycles": 683,
"bicycles": 146
}, {
"year": 1996,
"cars": 1617,
"motorcycles": 691,
"bicycles": 138
}, {
"year": 1997,
"cars": 1630,
"motorcycles": 642,
"bicycles": 127
}, {
"year": 1998,
"cars": 1660,
"motorcycles": 699,
"bicycles": 105
}, {
"year": 1999,
"cars": 1683,
"motorcycles": 721,
"bicycles": 109
}, {
"year": 2000,
"cars": 1691,
"motorcycles": 737,
"bicycles": 112
}, {
"year": 2001,
"cars": 1298,
"motorcycles": 680,
"bicycles": 101
}, {
"year": 2002,
"cars": 1275,
"motorcycles": 664,
"bicycles": 97
}, {
"year": 2003,
"cars": 1246,
"motorcycles": 648,
"bicycles": 93
}, {
"year": 2004,
"cars": 1218,
"motorcycles": 637,
"bicycles": 101
}, {
"year": 2005,
"cars": 1213,
"motorcycles": 633,
"bicycles": 87
}, {
"year": 2006,
"cars": 1199,
"motorcycles": 621,
"bicycles": 79
}, {
"year": 2007,
"cars": 1110,
"motorcycles": 210,
"bicycles": 81
}, {
"year": 2008,
"cars": 1165,
"motorcycles": 232,
"bicycles": 75
}, {
"year": 2009,
"cars": 1145,
"motorcycles": 219,
"bicycles": 88
}, {
"year": 2010,
"cars": 1163,
"motorcycles": 201,
"bicycles": 82
}, {
"year": 2011,
"cars": 1180,
"motorcycles": 285,
"bicycles": 87
}, {
"year": 2012,
"cars": 1159,
"motorcycles": 277,
"bicycles": 71
}]

View file

@ -0,0 +1,21 @@
[{
"year": 2005,
"income": 23.5,
"expenses": 18.1
}, {
"year": 2006,
"income": 26.2,
"expenses": 22.8
}, {
"year": 2007,
"income": 30.1,
"expenses": 23.9
}, {
"year": 2008,
"income": 29.5,
"expenses": 25.1
}, {
"year": 2009,
"income": 24.6,
"expenses": 25
}]

View file

@ -0,0 +1,70 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/gantt.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
AmCharts.useUTC = true;
var chart = AmCharts.makeChart("chartdiv", {
"type": "gantt",
"theme": "light",
"dataLoader": {
"url": "data/gantt.json"
},
"dataProvider": [],
"period": "hh",
"dataDateFormat": "YYYY-MM-DD",
"balloonDateFormat": "JJ:NN",
"columnWidth": 0.5,
"valueAxis": {
"type": "date",
"minimum": 7,
"maximum": 31
},
"brightnessStep": 10,
"graph": {
"fillAlphas": 1,
"balloonText": "<b>[[task]]</b>: [[open]] [[value]]"
},
"rotate": true,
"categoryField": "category",
"segmentsField": "segments",
"colorField": "color",
"startDate": "2015-01-01",
"startField": "start",
"endField": "end",
"durationField": "duration",
"chartScrollbar": {},
"chartCursor": {
"valueBalloonsEnabled": false,
"cursorAlpha": 0.1,
"valueLineBalloonEnabled": true,
"valueLineEnabled": true,
"fullWidth": true
}
});
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,58 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/gauge.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
var chart = AmCharts.makeChart( "chartdiv", {
"type": "gauge",
"startDuration": 0.1,
"dataLoader": {
"url": "data/gauge.json"
},
"axes": [ {
"id": "axis1",
"axisAlpha": 0,
"endAngle": 360,
"endValue": 12,
"minorTickInterval": 0.2,
"showFirstLabel": false,
"startAngle": 0,
"topTextYOffset": 100,
"valueInterval": 1
}, {
"id": "axis2",
"axisAlpha": 0,
"endAngle": 360,
"endValue": 60,
"radius": 60,
"showFirstLabel": false,
"startAngle": 0,
"valueInterval": 5,
"labelFrequency": 0,
"tickLength": 10
} ]
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<link rel="stylesheet" href="http://www.amcharts.com/lib/3/ammap.css" type="text/css">
<script src="http://www.amcharts.com/lib/3/ammap.js"></script>
<script src="http://www.amcharts.com/lib/3/maps/js/usaLow.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
var map = AmCharts.makeChart( "chartdiv", {
type: "map",
"dataLoader": {
"url": "data/map.json",
"showErrors": false
},
"colorSteps": 10,
"areasSettings": {
"autoZoom": true
},
"smallMap": {},
"valueLegend": {
"right": 10,
"minValue": "little",
"maxValue": "a lot!"
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,55 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<link rel="stylesheet" href="http://www.amcharts.com/lib/3/ammap.css" type="text/css">
<script src="http://www.amcharts.com/lib/3/ammap.js"></script>
<script src="http://www.amcharts.com/lib/3/maps/js/usaLow.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
/**
* We will use Data Loader's function to load data "externally"
* then create a map when it's loaded
*/
AmCharts.loadFile( "data/map_areas.json", {}, function( areas ) {
// now that we loaded our areas, let's create the map
var map = AmCharts.makeChart( "chartdiv", {
"type": "map",
"colorSteps": 10,
"dataProvider": {
"map": "usaLow",
"areas": AmCharts.parseJSON( areas )
},
"areasSettings": {
"autoZoom": true
},
"valueLegend": {
"right": 10,
"minValue": "little",
"maxValue": "a lot!"
}
} );
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,58 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
AmCharts.makeChart("chartdiv", {
"type": "pie",
"dataLoader": {
"url": "data/pie.csv",
"format": "csv",
"delimiter": ",",
"useColumnNames": true
},
"titleField": "country",
"valueField": "litres",
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"innerRadius": "30%",
"legend": {
"align": "center",
"markerType": "circle"
},
"responsive": {
"enabled": true,
"addDefaultRules": true,
"rules": [
{
"minWidth": 500,
"overrides": {
"innerRadius": "50%",
}
}
]
}
});
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
AmCharts.makeChart("chartdiv", {
"type": "pie",
"dataLoader": {
"url": "data/pie.json",
"showCurtain": false
},
"titleField": "country",
"valueField": "litres",
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"innerRadius": "30%",
"legend": {
"align": "center",
"markerType": "circle"
}
});
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,85 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/dark.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
background-color:#282828;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "dark",
"dataLoader": {
"url": "data/serial2.json",
"showErrors": true,
"complete": function ( chart ) {
console.log( "Loading complete" );
},
"load": function ( options, chart ) {
console.log( "File loaded: ", options.url );
},
"error": function ( options, chart ) {
console.log( "Error occured loading file: ", options.url );
}
},
"categoryField": "year",
"startDuration": 1,
"rotate": true,
"categoryAxis": {
"gridPosition": "start"
},
"valueAxes": [{
"position": "top",
"title": "Million USD",
"minorGridEnabled": true
}],
"graphs": [{
"type": "column",
"title": "Income",
"valueField": "income",
"fillAlphas":1,
"balloonText": "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b></span>"
}, {
"type": "line",
"title": "Expenses",
"valueField": "expenses",
"lineThickness": 2,
"bullet": "round",
"balloonText": "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b></span>"
}],
"legend": {
"useGraphSettings": true
},
"creditsPosition": "top-right",
"responsive": {
"enabled": true
}
});
function reloadData() {
chart.dataLoader.loadData();
}
</script>
</head>
<body>
<div id="chartdiv"></div>
<input type="button" value="Trigger data reload" onclick="reloadData();" />
</body>
</html>

View file

@ -0,0 +1,112 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"dataLoader": {
"url": "data/serial.csv",
"format": "csv",
"showCurtain": true,
"showErrors": true,
"async": true,
"reload": 10,
"timestamp": true,
"delimiter": ",",
"useColumnNames": true
},
"rotate": false,
"marginTop": 10,
"categoryField": "year",
"categoryAxis": {
"gridAlpha": 0.07,
"axisColor": "#DADADA",
"startOnAxis": false,
"title": "Year",
"guides": [{
"category": "2001",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "fines for speeding increased"
}, {
"category": "2007",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "motorcycle fee introduced"
}]
},
"valueAxes": [{
"stackType": "regular",
"gridAlpha": 0.07,
"title": "Traffic incidents"
}],
"graphs": [{
"id": "g1",
"type": "column",
"title": "Cars",
"valueField": "cars",
"bullet": "round",
"lineAlpha": 0,
"fillAlphas": 0.6
}, {
"id": "g2",
"type": "column",
"title": "Motorcycles",
"valueField": "motorcycles",
"lineAlpha": 0,
"fillAlphas": 0.6
}, {
"id": "g3",
"type": "column",
"title": "Bicycles",
"valueField": "bicycles",
"lineAlpha": 0,
"fillAlphas": 0.6
}],
"legend": {
"position": "bottom",
"valueText": "[[value]]",
"valueWidth": 100,
"valueAlign": "left",
"equalWidths": false,
"periodValueText": "total: [[value.sum]]"
},
"chartCursor": {
"cursorAlpha": 0
},
"chartScrollbar": {
"color": "FFFFFF"
}
});
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,108 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"dataLoader": {
"url": "data/serial.json",
"format": "json",
"showErrors": true,
"noStyles": true,
"async": true
},
"rotate": false,
"marginTop": 10,
"categoryField": "year",
"categoryAxis": {
"gridAlpha": 0.07,
"axisColor": "#DADADA",
"startOnAxis": false,
"title": "Year",
"guides": [{
"category": "2001",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "fines for speeding increased"
}, {
"category": "2007",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "motorcycle fee introduced"
}]
},
"valueAxes": [{
"stackType": "regular",
"gridAlpha": 0.07,
"title": "Traffic incidents"
}],
"graphs": [{
"id": "g1",
"type": "column",
"title": "Cars",
"valueField": "cars",
"bullet": "round",
"lineAlpha": 0,
"fillAlphas": 0.6
}, {
"id": "g2",
"type": "column",
"title": "Motorcycles",
"valueField": "motorcycles",
"lineAlpha": 0,
"fillAlphas": 0.6
}, {
"id": "g3",
"type": "column",
"title": "Bicycles",
"valueField": "bicycles",
"lineAlpha": 0,
"fillAlphas": 0.6
}],
"legend": {
"position": "bottom",
"valueText": "[[value]]",
"valueWidth": 100,
"valueAlign": "left",
"equalWidths": false,
"periodValueText": "total: [[value.sum]]"
},
"chartCursor": {
"cursorAlpha": 0
},
"chartScrollbar": {
"color": "FFFFFF"
}
});
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,100 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"dataLoader": {
"url": "data/serial.json",
"format": "json",
"showErrors": true,
"noStyles": true,
"async": true,
"load": function( options, chart ) {
// Here the data is already loaded and set to the chart.
// We can iterate through it and add proper graphs
for ( var key in chart.dataProvider[ 0 ] ) {
if ( chart.dataProvider[ 0 ].hasOwnProperty( key ) && key != chart.categoryField ) {
var graph = new AmCharts.AmGraph();
graph.valueField = key;
graph.type = "line";
graph.title = key,
graph.lineThickness = 2;
chart.addGraph( graph );
}
}
}
},
"rotate": false,
"marginTop": 10,
"categoryField": "year",
"categoryAxis": {
"gridAlpha": 0.07,
"axisColor": "#DADADA",
"startOnAxis": false,
"title": "Year",
"guides": [{
"category": "2001",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "fines for speeding increased"
}, {
"category": "2007",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "motorcycle fee introduced"
}]
},
"valueAxes": [{
"stackType": "regular",
"gridAlpha": 0.07,
"title": "Traffic incidents"
}],
"graphs": [],
"legend": {
"position": "bottom",
"valueText": "[[value]]",
"valueWidth": 100,
"valueAlign": "left",
"equalWidths": false,
"periodValueText": "total: [[value.sum]]"
},
"chartCursor": {
"cursorAlpha": 0
},
"chartScrollbar": {
"color": "FFFFFF"
}
});
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,312 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/amstock.js"></script>
<script src="../dataloader.min.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
background: #000;
}
#chartdiv {
width: 100%;
height: 500px;
position: relative;
}
#chartdiv .amChartsPeriodSelector {
padding-left: 35px;
}
.amChartsButtonSelected {
font-weight: bold;
}
.amChartsButton {
color: #fff;
background: transparent;
opacity: 0.7;
border: 1px solid rgba(255,255,2555,.3);
-moz-border-radius: 5px;
border-radius: 5px;
margin: 1px;
outline: none;
box-sizing: border-box;
}
.amChartsInputField {
color: #000;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "stock",
"color": "#fff",
"dataSets": [{
"title": "MSFT",
"fieldMappings": [{
"fromField": "Open",
"toField": "open"
}, {
"fromField": "High",
"toField": "high"
}, {
"fromField": "Low",
"toField": "low"
}, {
"fromField": "Close",
"toField": "close"
}, {
"fromField": "Volume",
"toField": "volume"
}],
"compared": false,
"categoryField": "Date",
/**
* data loader for data set data
*/
"dataLoader": {
"url": "data/MSFT.csv",
"format": "csv",
"showCurtain": true,
"showErrors": true,
"async": true,
"reverse": true,
"delimiter": ",",
"useColumnNames": true
},
/**
* data loader for events data
*/
"eventDataLoader": {
"url": "data/MSFT_events.csv",
"format": "csv",
"showCurtain": true,
"showErrors": true,
"async": true,
"reverse": true,
"delimiter": ",",
"useColumnNames": true,
"postProcess": function ( data ) {
for ( var x in data ) {
switch( data[x].Type ) {
case 'A':
var color = "#85CDE6";
break;
default:
var color = "#cccccc";
break;
}
data[x].Description = data[x].Description.replace( "Upgrade", "<strong style=\"color: #0c0\">Upgrade</strong>" ).replace( "Downgrade", "<strong style=\"color: #c00\">Downgrade</strong>" );
data[x] = {
type: "pin",
graph: "g1",
backgroundColor: color,
date: data[x].Date,
text: data[x].Type,
description: "<strong>" + data[x].Title + "</strong><br />" + data[x].Description
};
}
return data;
}
}
}, {
"title": "TXN",
"fieldMappings": [{
"fromField": "Open",
"toField": "open"
}, {
"fromField": "High",
"toField": "high"
}, {
"fromField": "Low",
"toField": "low"
}, {
"fromField": "Close",
"toField": "close"
}, {
"fromField": "Volume",
"toField": "volume"
}],
"compared": true,
"categoryField": "Date",
"dataLoader": {
"url": "data/TXN.csv",
"format": "csv",
"showCurtain": true,
"showErrors": true,
"async": true,
"reverse": true,
"delimiter": ",",
"useColumnNames": true
}
}],
"dataDateFormat": "YYYY-MM-DD",
"panels": [{
"title": "Value",
"percentHeight": 70,
"stockGraphs": [{
"type": "candlestick",
"id": "g1",
"openField": "open",
"closeField": "close",
"highField": "high",
"lowField": "low",
"valueField": "close",
"lineColor": "#fff",
"fillColors": "#fff",
"negativeLineColor": "#db4c3c",
"negativeFillColors": "#db4c3c",
"fillAlphas": 1,
"comparedGraphLineThickness": 2,
"columnWidth": 0.7,
"useDataSetColors": false,
"comparable": true,
"compareField": "close",
"showBalloon": false,
"proCandlesticks": true
}],
"stockLegend": {
"valueTextRegular": undefined,
"periodValueTextComparing": "[[percents.value.close]]%"
}
},
{
"title": "Volume",
"percentHeight": 30,
"marginTop": 1,
"columnWidth": 0.6,
"showCategoryAxis": false,
"stockGraphs": [{
"valueField": "volume",
"openField": "open",
"type": "column",
"showBalloon": false,
"fillAlphas": 1,
"lineColor": "#fff",
"fillColors": "#fff",
"negativeLineColor": "#db4c3c",
"negativeFillColors": "#db4c3c",
"useDataSetColors": false
}],
"stockLegend": {
"markerType": "none",
"markerSize": 0,
"labelText": "",
"periodValueTextRegular": "[[value.close]]"
},
"valueAxes": [{
"usePrefixes": true
}]
}
],
"panelsSettings": {
"color": "#fff",
"plotAreaFillColors": "#333",
"plotAreaFillAlphas": 1,
"marginLeft": 60,
"marginTop": 5,
"marginBottom": 5
},
"chartScrollbarSettings": {
"graph": "g1",
"graphType": "line",
"usePeriod": "WW",
"backgroundColor": "#333",
"graphFillColor": "#666",
"graphFillAlpha": 0.5,
"gridColor": "#555",
"gridAlpha": 1,
"selectedBackgroundColor": "#444",
"selectedGraphFillAlpha": 1
},
"categoryAxesSettings": {
"equalSpacing": true,
"gridColor": "#555",
"gridAlpha": 1
},
"valueAxesSettings": {
"gridColor": "#555",
"gridAlpha": 1,
"inside": false,
"showLastLabel": true
},
"chartCursorSettings": {
"pan": true,
"valueLineEnabled": true,
"valueLineBalloonEnabled": true
},
"legendSettings": {
"color": "#fff"
},
"stockEventsSettings": {
"showAt": "high",
"type": "pin"
},
"balloon": {
"textAlign": "left",
"offsetY": 10
},
"periodSelector": {
"position": "bottom",
"periods": [{
"period": "DD",
"count": 10,
"label": "10D"
}, {
"period": "MM",
"count": 1,
"label": "1M"
}, {
"period": "MM",
"count": 6,
"label": "6M"
}, {
"period": "YYYY",
"count": 1,
"label": "1Y"
}, {
"period": "YYYY",
"count": 2,
"selected": true,
"label": "2Y"
}, {
"period": "YTD",
"label": "YTD"
}, {
"period": "MAX",
"label": "MAX"
}]
}
});
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,371 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>amCharts Data Loader Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/amstock.js"></script>
<script src="../dataloader.min.js"></script>
<!-- jQuery UI resources used for progress bar -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<style>
body, html {
font-family: Verdana;
font-size: 12px;
background: #000;
}
#chartcontainer, #chartdiv {
width: 100%;
height: 500px;
position: relative;
}
#chartdiv .amChartsPeriodSelector {
padding-left: 35px;
}
.amChartsButtonSelected {
font-weight: bold;
}
.amChartsButton {
color: #fff;
background: transparent;
opacity: 0.7;
border: 1px solid rgba(255,255,2555,.3);
-moz-border-radius: 5px;
border-radius: 5px;
margin: 1px;
outline: none;
box-sizing: border-box;
}
.amChartsInputField {
color: #000;
}
.ui-progressbar {
position: absolute;
top: 50%;
margin-top: -15px;
left: 50%;
margin-left: -150px;
width: 300px;
text-align: center;
}
.progress-label {
position: absolute;
left: 50%;
top: 4px;
margin-left: -15px;
font-weight: bold;
text-shadow: 1px 1px 0 #fff;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "stock",
"color": "#fff",
"dataSets": [{
"title": "MSFT",
"fieldMappings": [{
"fromField": "Open",
"toField": "open"
}, {
"fromField": "High",
"toField": "high"
}, {
"fromField": "Low",
"toField": "low"
}, {
"fromField": "Close",
"toField": "close"
}, {
"fromField": "Volume",
"toField": "volume"
}],
"compared": false,
"categoryField": "Date",
/**
* data loader for data set data
*/
"dataLoader": {
"url": "data/MSFT.csv",
"format": "csv",
"showCurtain": false,
"showErrors": true,
"async": true,
"reverse": true,
"delimiter": ",",
"useColumnNames": true,
"progress": udpateProgress
},
/**
* data loader for events data
*/
"eventDataLoader": {
"url": "data/MSFT_events.csv",
"format": "csv",
"showCurtain": false,
"showErrors": true,
"async": true,
"reverse": true,
"delimiter": ",",
"useColumnNames": true,
"progress": udpateProgress,
"postProcess": function ( data ) {
for ( var x in data ) {
switch( data[x].Type ) {
case 'A':
var color = "#85CDE6";
break;
default:
var color = "#cccccc";
break;
}
data[x].Description = data[x].Description.replace( "Upgrade", "<strong style=\"color: #0c0\">Upgrade</strong>" ).replace( "Downgrade", "<strong style=\"color: #c00\">Downgrade</strong>" );
data[x] = {
type: "pin",
graph: "g1",
backgroundColor: color,
date: data[x].Date,
text: data[x].Type,
description: "<strong>" + data[x].Title + "</strong><br />" + data[x].Description
};
}
return data;
}
}
}, {
"title": "TXN",
"fieldMappings": [{
"fromField": "Open",
"toField": "open"
}, {
"fromField": "High",
"toField": "high"
}, {
"fromField": "Low",
"toField": "low"
}, {
"fromField": "Close",
"toField": "close"
}, {
"fromField": "Volume",
"toField": "volume"
}],
"compared": true,
"categoryField": "Date",
"dataLoader": {
"url": "data/TXN.csv",
"format": "csv",
"showCurtain": false,
"showErrors": true,
"async": true,
"reverse": true,
"delimiter": ",",
"useColumnNames": true,
"progress": udpateProgress
}
}],
"dataDateFormat": "YYYY-MM-DD",
"panels": [{
"title": "Value",
"percentHeight": 70,
"stockGraphs": [{
"type": "candlestick",
"id": "g1",
"openField": "open",
"closeField": "close",
"highField": "high",
"lowField": "low",
"valueField": "close",
"lineColor": "#fff",
"fillColors": "#fff",
"negativeLineColor": "#db4c3c",
"negativeFillColors": "#db4c3c",
"fillAlphas": 1,
"comparedGraphLineThickness": 2,
"columnWidth": 0.7,
"useDataSetColors": false,
"comparable": true,
"compareField": "close",
"showBalloon": false,
"proCandlesticks": true
}],
"stockLegend": {
"valueTextRegular": undefined,
"periodValueTextComparing": "[[percents.value.close]]%"
}
},
{
"title": "Volume",
"percentHeight": 30,
"marginTop": 1,
"columnWidth": 0.6,
"showCategoryAxis": false,
"stockGraphs": [{
"valueField": "volume",
"openField": "open",
"type": "column",
"showBalloon": false,
"fillAlphas": 1,
"lineColor": "#fff",
"fillColors": "#fff",
"negativeLineColor": "#db4c3c",
"negativeFillColors": "#db4c3c",
"useDataSetColors": false
}],
"stockLegend": {
"markerType": "none",
"markerSize": 0,
"labelText": "",
"periodValueTextRegular": "[[value.close]]"
},
"valueAxes": [{
"usePrefixes": true
}]
}
],
"listeners": [{
"event": "dataUpdated",
"method": function() {
progressbar.hide();
}
}],
"panelsSettings": {
"color": "#fff",
"plotAreaFillColors": "#333",
"plotAreaFillAlphas": 1,
"marginLeft": 60,
"marginTop": 5,
"marginBottom": 5
},
"chartScrollbarSettings": {
"graph": "g1",
"graphType": "line",
"usePeriod": "WW",
"backgroundColor": "#333",
"graphFillColor": "#666",
"graphFillAlpha": 0.5,
"gridColor": "#555",
"gridAlpha": 1,
"selectedBackgroundColor": "#444",
"selectedGraphFillAlpha": 1
},
"categoryAxesSettings": {
"equalSpacing": true,
"gridColor": "#555",
"gridAlpha": 1
},
"valueAxesSettings": {
"gridColor": "#555",
"gridAlpha": 1,
"inside": false,
"showLastLabel": true
},
"chartCursorSettings": {
"pan": true,
"valueLineEnabled": true,
"valueLineBalloonEnabled": true
},
"legendSettings": {
"color": "#fff"
},
"stockEventsSettings": {
"showAt": "high",
"type": "pin"
},
"balloon": {
"textAlign": "left",
"offsetY": 10
},
"periodSelector": {
"position": "bottom",
"periods": [{
"period": "DD",
"count": 10,
"label": "10D"
}, {
"period": "MM",
"count": 1,
"label": "1M"
}, {
"period": "MM",
"count": 6,
"label": "6M"
}, {
"period": "YYYY",
"count": 1,
"label": "1Y"
}, {
"period": "YYYY",
"count": 2,
"selected": true,
"label": "2Y"
}, {
"period": "YTD",
"label": "YTD"
}, {
"period": "MAX",
"label": "MAX"
}]
}
});
var progressbar, progressLabel;
function udpateProgress( totalPercent, filePercent, url ) {
// initialize progress bar
if ( progressbar === undefined ) {
progressbar = $( "#progressbar" ).show();
progressLabel = $( ".progress-label" );
progressbar.progressbar( {
value: false,
change: function() {
progressLabel.text( progressbar.progressbar( "value" ) + "%" );
},
complete: function() {
progressLabel.text( "100%" );
}
} );
}
// update value
progressbar.progressbar( "value", totalPercent );
}
</script>
</head>
<body>
<div id="chartcontainer">
<div id="chartdiv"></div>
<div id="progressbar" style="display: none;"><div class="progress-label">...</div></div>
</div>
</body>
</html>

View file

@ -0,0 +1,2 @@
require("amcharts3/amcharts/amcharts.js");
require("./dataloader.min.js");

View file

@ -0,0 +1,6 @@
AmCharts.translations.dataLoader.cs = {
'Error loading the file': 'Došlo k chybě při načítání souboru',
'Error parsing JSON file': 'Chyba při zpracování JSON souboru',
'Unsupported data format': 'Nepodporovaný formát souboru',
'Loading data...': 'Načítám data...'
}

View file

@ -0,0 +1,6 @@
AmCharts.translations.dataLoader.en = {
'Error loading the file': 'Error loading the file',
'Error parsing JSON file': 'Error parsing JSON file',
'Unsupported data format': 'Unsupported data format',
'Loading data...': 'Loading data...'
}

View file

@ -0,0 +1,6 @@
AmCharts.translations.dataLoader.fr = {
'Error loading the file': 'Erreur lors du chargement du fichier',
'Error parsing JSON file': 'Erreur lors de l\'analyse du fichier JSON',
'Unsupported data format': 'Le format des données n\'est pas supporté',
'Loading data...': 'Chargement des données...'
}

View file

@ -0,0 +1,6 @@
AmCharts.translations.dataLoader.lt = {
'Error loading the file': 'Nepavyko užkrauti failo',
'Error parsing JSON file': 'Skaitant JSON failą įvyko klaida',
'Unsupported data format': 'Nepalaikomas duomenų formatas',
'Loading data...': 'Kraunami duomenys...'
}

View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,10 @@
{
"name": "amcharts3-dataloader",
"version": "1.0.16",
"license": "SEE LICENSE IN LICENSE",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/amcharts/dataloader.git"
}
}

View file

@ -0,0 +1,425 @@
# amCharts Data Loader
Version: 1.0.16
## Description
By default all amCharts libraries accept data in JSON format. It needs to be
there when the web page loads, defined in-line or loaded via custom code.
This plugin introduces are native wrapper that enables automatic loading of data
from external data data sources in CSV and JSON formats.
Most of the times you will just need to provide a URL of the external data
source - static file or dynamically generated - and it will do the rest.
## Important notice
Due to security measures implemented in most of the browsers, the external data
loader will work only when the page with the chart or map is loaded via web
server.
So, any of the examples loaded locally (file:///) will not work.
The page needs to be loaded via web server (http://) in order to work properly.
Loading data from another domain than the web page is loaded is possible but is
a subject for `Access-Control-Allow-Origin` policies defined by the web server
you are loading data from.
For more about loading data across domains use the following thread:
http://stackoverflow.com/questions/1653308/access-control-allow-origin-multiple-origin-domains
## Usage
### 1) Include the minified version of file of this plugin. I.e.:
```
<script src="amcharts/plugins/dataloader/dataloader.min.js" type="text/javascript"></script>
```
(this needs to go after all the other amCharts includes)
### 2) Add data source properties to your chart configuration.
Regular (Serial, Pie, etc.) charts:
```
AmCharts.makeChart( "chartdiv", {
...,
"dataLoader": {
"url": "data.json",
"format": "json"
}
} );
```
Stock chart:
```
AmCharts.makeChart( "chartdiv", {
...,
"dataSets": [{
...,
"dataLoader": {
"url": "data.csv",
"format": "csv",
"delimiter": ",", // column separator
"useColumnNames": true, // use first row for column names
"skip": 1 // skip header row
}
}]
} );
```
That's it. The plugin will make sure the files are loaded and dataProvider is
populated with their content *before* the chart is built.
Some formats, like CSV, will require additional parameters needed to parse the
data, such as "separator".
If the "format" is omitted, the plugin will assume JSON.
### Using in object-based chart setup
If youre still using object-based chart setup, assign dataLoader-related config object to chart objects `dataLoader` property:
```
var chart = new AmCharts.AmSerialChart();
...
chart["dataLoader"] = {
"url": "data.csv",
"format": "csv",
"delimiter": ",",
"useColumnNames": true,
"skip": 1
};
```
## Complete list of available dataLoader settings
Property | Default | Description
-------- | ------- | -----------
async | true | If set to false (not recommended) everything will wait until data is fully loaded
complete | | Callback function to execute when loader is done
delimiter | , | [CSV only] a delimiter for columns (use \t for tab delimiters)
emptyAs | undefined | [CSV only] replace empty columns with whatever is set here
error | | Callback function to execute if file load fails
init | | Callback function to execute when Data Loader is initialized, before any loading starts
format | json | Type of data: json, csv
headers | | An array of objects with two properties (key and value) to attach to HTTP request
load | | Callback function to execute when file is successfully loaded (might be invoked multiple times)
noStyles | false | If set to true no styles will be applied to "Data loading" curtain
numberFields | | [CSV only] An array of fields in data to treat as numbers
postProcess | | If set to function reference, that function will be called to "post-process" loaded data before passing it on to chart. The handler function will receive two parameters: loaded data, Data Loader options
progress | | Set this to function reference to track progress of the load. The function will be passed in three parameters: global progress, individual file progress, file URL.
showErrors | true | Show loading errors in a chart curtain
showCurtain | true| Show curtain over the chart area when loading data
reload | 0 | Reload data every X seconds
reverse | false | [CSV only] add data points in revers order
skip | 0 | [CSV only] skip X first rows in data (includes first row if useColumnNames is used)
skipEmpty | true | [CSV only] Ignore empty lines in data
timestamp | false | Add current timestamp to data URLs (to avoid caching)
useColumnNames | false | [CSV only] Use first row in data as column names when parsing
## Using in JavaScript Stock Chart
In JavaScript Stock Chart it works exactly the same as in other chart types,
with the exception that `dataLoader` is set as a property to the data set
definition. I.e.:
```
var chart = AmCharts.makeChart("chartdiv", {
"type": "stock",
...
"dataSets": [{
"title": "MSFT",
"fieldMappings": [{
"fromField": "Open",
"toField": "open"
}, {
"fromField": "High",
"toField": "high"
}, {
"fromField": "Low",
"toField": "low"
}, {
"fromField": "Close",
"toField": "close"
}, {
"fromField": "Volume",
"toField": "volume"
}],
"compared": false,
"categoryField": "Date",
"dataLoader": {
"url": "data/MSFT.csv",
"format": "csv",
"showCurtain": true,
"showErrors": true,
"async": true,
"reverse": true,
"delimiter": ",",
"useColumnNames": true
}
}
}]
});
```
### Can I also load event data the same way?
Sure. You just add a `eventDataLoader` object to your data set. All the same
settings apply.
## Adding custom headers to HTTP requests
If you want to add additional headers to your data load HTTP requests, use
"headers" array. Each header is an object with two keys: "key" and "value":
```
"dataLoader": {
"url": "data/serial.json",
"format": "json",
"headers": [{
"key": "x-access-token",
"value": "123456789"
}]
}
```
## Manually triggering a reload of all data
Once chart is initialized, you can trigger the reload of all data manually by
calling `chart.dataLoader.loadData()` function. (replace "chart" with the actual
variable that holds reference to your chart object)
## Using callback functions
Data Loader can call your own function when certain event happens, like data
loading is complete, error occurs, etc.
To set custom event handlers, use these config options:
* "complete"
* "init"
* "load"
* "error"
* "progress"
Example:
```
AmCharts.makeChart( "chartdiv", {
...,
"dataSets": [{
...,
"dataLoader": {
"url": "data.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 ) );
}
}
}]
} );
```
## Using Data Loader's standalone functions
Data Loader's load and parsing functions are available for external standalone use.
The three available functions are as follows:
Function | Parameters | Description
-------- | ---------- | -----------
AmCharts.loadFile() | url, options, callback | Loads the file and passes it into callback function (unparsed)
AmCharts.parseCSV() | data, options | Parses data in string CSV format and returns JavaScript Array
AmCharts.parseJSON() | data | Parses data in string JSON format and returns JavaScript Array
The options passed into standalone functions are the same as discussed in [Complete list of available dataLoader settings](#complete-list-of-available-dataloader-settings) chapter.
### JSON Example
```
AmCharts.loadFile(dataset_url, {}, function(data) {
var chartData = AmCharts.parseJSON(data);
console.log(chartData); // this will output an array
});
```
### CSV Example
```
AmCharts.loadFile(dataset_url, {}, function(data) {
var chartData = AmCharts.parseCSV(data, {
"delimiter": ",",
"useColumnNames": true
});
console.log(chartData); // this will output an array
});
```
## Translating into other languages
Depending on configuration options the plugin will display a small number of
text prompts, like 'Data loading...'.
Plugin will try matching chart's `language` property and display text prompts in
a corresponding language. For that the plugin needs to have the translations.
Some of the plugin translations are in **lang** subdirectory. Simply include the
one you need.
If there is no translation to your language readily available, just grab en.js,
copy it and translate.
The structure is simple:
```
'The phrase in English': 'Translation'
```
The phrase in English must be left intact.
When you're done, you can include your language as a JavaScript file.
P.S. send us your translation so we can include it for the benefits of other
users. Thanks!
## Requirements
This plugin requires at least 3.13 version of JavaScript Charts, JavaScript
Stock Chart or JavaScript Maps.
## Demos
They're all in subdirectory /examples.
## Extending this plugin
You're encouraged to modify, extend and make derivative plugins out of this
plugin.
You can modify files, included in this archive or, better yet, fork this project
on GitHub:
https://github.com/amcharts/dataloader
We're curious types. Please let us know (contact@amcharts.com) if you do create
something new out of this plugin.
## License
This plugin is licensed under Apache License 2.0.
This basically means you're free to use or modify this plugin, even make your
own versions or completely different products out of it.
Please see attached file "license.txt" for the complete license or online here:
http://www.apache.org/licenses/LICENSE-2.0
## Contact us
* Email:contact@amcharts.com
* Web: http://www.amcharts.com/
* Facebook: https://www.facebook.com/amcharts
* Twitter: https://twitter.com/amcharts
## Changelog
### 1.0.16
* Added "numberFields" config array
### 1.0.15
* Added "emptyAs" config property. Empty CSV values will be set to this (default `undefined`)
### 1.0.14
* Added "init" event handler, which is called **before** loading starts
### 1.0.13
* Added "progress" handler, which can be used to monitor data load progress
### 1.0.12
* Better default options handling in external calls to AmCharts.loadFile
* Fixed the latest version of Stock Chart not resetting to default pre-defined period
* New example: Using Data Loader functions externally (map_json_external_function.html)
### 1.0.11
* New translation: Added French translation. Thanks Remy!
* Tweaks to allow better animation after data load on Pie chart
### 1.0.10
* Fixed error related to headers not being set when using standalone data load functions
### 1.0.9
* Plugin will now ignore empty CSV lines by default (configurable with `skipEmpty` property)
### 1.0.8
* Added `headers` config variable which allows adding custom headers to HTTP requests
### 1.0.7
* Fixed an issue with the Pie chart when it is being loaded in inactive tab
### 1.0.6
* Added support for Gauge chart (loads `arrows` array)
### 1.0.5
* Fixed JS error if periodSelector was not defined in chart config
* Now all callback functions (complete, error, load) receive additional parameter: chart
* postProcess function will now have "this" context set to Data Loader object as well as receive chart reference as third paramater
### 1.0.4
* Added `chart.dataLoader.loadData()` function which can be used to manually trigger all data reload
### 1.0.3
* Fixed the bug where defaults were not being applied properly
* Fixed the bug with translations not being applied properly
* Cleaned up the code (to pass JSHint validation)
### 1.0.2
* Fixed the issue with modified Array prototypes
### 1.0.1
* Added `complete`, `load` and `error` properties that can be set with function handlers to be invoked on load completion, successful file load or failed load respectively
* Fixed language container initialization bug
* Fixed bug that was causing parse errors not be displayed
### 1.0
* Added GANTT chart support
### 0.9.2
* Added global data load methods that can be used to load and parse data by code outside plugin
* Trim CSV column names
* Translation added: Lithuanian
### 0.9.1
* Fix chart animations not playing after asynchronous load
### 0.9
* Initial release

View file

@ -0,0 +1,2 @@
.DS_Store

View file

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,28 @@
{
"name": "amcharts3-export",
"authors": [
"amCharts <contact@amcharts.com>"
],
"description": "amCharts V3 Export plugin",
"main": [
"export.js"
],
"keywords": [
"amcharts",
"charts",
"javascript",
"plugin"
],
"moduleType": [
"globals"
],
"dependencies": {
"amcharts3": ">= 3.11.1"
},
"license": "Apache-2.0",
"homepage": "https://www.amcharts.com/",
"repository": {
"type": "git",
"url": "git://github.com/amcharts/export.git"
}
}

View file

@ -0,0 +1,257 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="../../../AmDebug/lib/amcharts/amcharts.js"></script>
<script src="../../../AmDebug/lib/amcharts/serial.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<script src="export.config.advanced.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "serial",
"theme": "light",
"legend": {
"equalWidths": false,
"useGraphSettings": true,
"valueAlign": "left",
"valueWidth": 120
},
"dataProvider": [ {
"date": "2012-01-01",
"distance": 227,
"townName": "New York",
"townName2": "New York",
"townSize": 25,
"latitude": 40.71,
"duration": 408
}, {
"date": "2012-01-02",
"distance": 371,
"townName": "Washington",
"townSize": 14,
"latitude": 38.89,
"duration": 482
}, {
"date": "2012-01-03",
"distance": 433,
"townName": "Wilmington",
"townSize": 6,
"latitude": 34.22,
"duration": 562
}, {
"date": "2012-01-04",
"distance": 345,
"townName": "Jacksonville",
"townSize": 7,
"latitude": 30.35,
"duration": 379
}, {
"date": "2012-01-05",
"distance": 480,
"townName": "Miami",
"townName2": "Miami",
"townSize": 10,
"latitude": 25.83,
"duration": 501
}, {
"date": "2012-01-06",
"distance": 386,
"townName": "Tallahassee",
"townSize": 7,
"latitude": 30.46,
"duration": 443
}, {
"date": "2012-01-07",
"distance": 348,
"townName": "New Orleans",
"townSize": 10,
"latitude": 29.94,
"duration": 405
}, {
"date": "2012-01-08",
"distance": 238,
"townName": "Houston",
"townName2": "Houston",
"townSize": 16,
"latitude": 29.76,
"duration": 309
}, {
"date": "2012-01-09",
"distance": 218,
"townName": "Dalas",
"townSize": 17,
"latitude": 32.8,
"duration": 287
}, {
"date": "2012-01-10",
"distance": 349,
"townName": "Oklahoma City",
"townSize": 11,
"latitude": 35.49,
"duration": 485
}, {
"date": "2012-01-11",
"distance": 603,
"townName": "Kansas City",
"townSize": 10,
"latitude": 39.1,
"duration": 890
}, {
"date": "2012-01-12",
"distance": 534,
"townName": "Denver",
"townName2": "Denver",
"townSize": 18,
"latitude": 39.74,
"duration": 810
}, {
"date": "2012-01-13",
"townName": "Salt Lake City",
"townSize": 12,
"distance": 425,
"duration": 670,
"latitude": 40.75,
"dashLength": 8,
"alpha": 0.4
}, {
"date": "2012-01-14",
"latitude": 36.1,
"duration": 470,
"townName": "Las Vegas",
"townName2": "Las Vegas"
}, {
"date": "2012-01-15"
}, {
"date": "2012-01-16"
}, {
"date": "2012-01-17"
}, {
"date": "2012-01-18"
}, {
"date": "2012-01-19"
} ],
"valueAxes": [ {
"id": "distanceAxis",
"axisAlpha": 0,
"gridAlpha": 0,
"position": "left",
"title": "distance"
}, {
"id": "latitudeAxis",
"axisAlpha": 0,
"gridAlpha": 0,
"labelsEnabled": false,
"position": "right"
}, {
"id": "durationAxis",
"duration": "mm",
"durationUnits": {
"hh": "h ",
"mm": "min"
},
"axisAlpha": 0,
"gridAlpha": 0,
"inside": true,
"position": "right",
"title": "duration"
} ],
"graphs": [ {
"alphaField": "alpha",
"balloonText": "[[value]] miles",
"dashLengthField": "dashLength",
"fillAlphas": 0.7,
"legendPeriodValueText": "total: [[value.sum]] mi",
"legendValueText": "[[value]] mi",
"title": "distance",
"type": "column",
"valueField": "distance",
"valueAxis": "distanceAxis"
}, {
"balloonText": "latitude:[[value]]",
"bullet": "round",
"bulletBorderAlpha": 1,
"useLineColorForBulletBorder": true,
"bulletColor": "#FFFFFF",
"bulletSizeField": "townSize",
"dashLengthField": "dashLength",
"descriptionField": "townName",
"labelPosition": "right",
"labelText": "[[townName2]]",
"legendValueText": "[[description]]/[[value]]",
"title": "latitude/city",
"fillAlphas": 0,
"valueField": "latitude",
"valueAxis": "latitudeAxis"
}, {
"bullet": "square",
"bulletBorderAlpha": 1,
"bulletBorderThickness": 1,
"dashLengthField": "dashLength",
"legendValueText": "[[value]]",
"title": "duration",
"fillAlphas": 0,
"valueField": "duration",
"valueAxis": "durationAxis"
} ],
"chartCursor": {
"categoryBalloonDateFormat": "DD",
"cursorAlpha": 0.1,
"cursorColor": "#000000",
"fullWidth": true,
"valueBalloonsEnabled": false,
"zoomable": false
},
"dataDateFormat": "YYYY-MM-DD",
"categoryField": "date",
"categoryAxis": {
"dateFormats": [ {
"period": "DD",
"format": "DD"
}, {
"period": "WW",
"format": "MMM DD"
}, {
"period": "MM",
"format": "MMM"
}, {
"period": "YYYY",
"format": "YYYY"
} ],
"parseDates": true,
"autoGridCount": false,
"axisColor": "#555555",
"gridAlpha": 0.1,
"gridColor": "#FFFFFF",
"gridCount": 50
},
"export": AmCharts.exportCFG
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,259 @@
/**
* This is a sample chart export config file. It is provided as a reference on
* how miscelaneous items in export menu can be used and set up.
*
* Please refer to README.md for more information.
*/
/**
* PDF-specfic configuration
*/
AmCharts.exportDrawingMenu = [ {
class: "export-drawing",
label: "Export",
menu: [ {
label: "Undo",
click: function() {
this.drawing.handler.undo();
}
}, {
label: "Redo",
click: function() {
this.drawing.handler.redo();
}
}, {
label: "Cancel",
click: function() {
this.drawing.handler.done();
}
}, {
label: "Save",
menu: [ {
label: "JPG",
click: function() {
this.drawing.handler.done();
this.toJPG( {}, function( data ) {
this.download( data, "image/jpg", "amCharts.jpg" );
} );
}
}, {
label: "PNG",
click: function() {
this.drawing.handler.done();
this.toPNG( {}, function( data ) {
this.download( data, "image/png", "amCharts.png" );
} );
}
}, {
label: "PDF",
click: function() {
this.drawing.handler.done();
this.toPDF( {}, function( data ) {
this.download( data, "application/pdf", "amCharts.pdf" );
} );
}
}, {
label: "SVG",
click: function() {
this.drawing.handler.done();
this.toSVG( {}, function( data ) {
this.download( data, "text/xml", "amCharts.svg" );
} );
}
} ]
} ]
} ];
/**
* Define main universal config
*/
AmCharts.exportCFG = {
enabled: true,
libs: {
path: "../libs/"
},
menu: [ {
class: "export-main",
label: "Export",
menu: [
/*
** DRAWING
*/
{
label: "Draw",
click: function() {
this.capture( {
action: "draw",
freeDrawingBrush: {
width: 2,
color: "#000000",
shadow: {
color: "rgba(0,0,0,0.3)",
blur: 10,
offsetX: 3,
offsetY: 3
}
}
}, function() {
this.createMenu( AmCharts.exportDrawingMenu );
} );
}
},
/*
** DELAYED DRAWING
*/
{
label: "Delayed draw",
action: "draw",
delay: 2
},
/*
** DELAYED EXPORT; automatical download
*/
{
label: "Delayed save",
format: "png",
delay: 2
},
/*
** WATERMARK EXPORT; Post procesing
*/
{
label: "Watermark",
format: "png",
action: false, // Avoids automatical downloads
afterCapture: function() {
var canvas = this.setup.fabric;
var watermark = new fabric.Text("watermark",{
originX: "center",
originY: "center",
top: canvas.height / 2,
left: canvas.width / 2,
fontSize: 50,
opacity: 0.4
});
// Add watermark to canvas
// In case of images ensure the images has been fully loaded before converting
canvas.add(watermark);
// Convert to PNG
this.toPNG({},function(base64) {
var format = this.defaults.formats.PNG;
var fileType = format.mimeType;
var fileName = "amCharts." + format.extension;
var fileData = base64;
// Trigger download
this.download(fileData,fileType,fileName);
});
}
},
/*
** DOWNLOAD
*/
{
label: "Download",
menu: [ {
label: "JPG",
click: function() {
this.capture( {}, function() {
this.toJPG( {}, function( data ) {
this.download( data, "image/jpg", "amCharts.jpg" );
} );
} );
}
}, {
label: "PNG",
click: function() {
this.capture( {}, function() {
this.toPNG( {}, function( data ) {
this.download( data, "image/png", "amCharts.png" );
} );
} );
}
}, {
label: "PDF",
click: function() {
this.capture( {}, function() {
this.toPDF( {}, function( data ) {
this.download( data, "application/pdf", "amCharts.pdf" );
} );
} );
}
}, {
label: "PDF + data",
click: function() {
this.capture( {}, function() {
var tableData = this.setup.chart.dataProvider;
var tableBody = this.toArray( {
withHeader: true,
data: tableData
} );
var tableWidths = [];
var content = [ {
image: "reference",
fit: [ 523.28, 769.89 ]
} ];
for ( i in tableBody[ 0 ] ) {
tableWidths.push( "*" );
}
content.push( {
table: {
headerRows: 1,
widths: tableWidths,
body: tableBody
},
layout: 'lightHorizontalLines'
} );
this.toPDF( {
content: content
}, function( data ) {
this.download( data, "application/pdf", "amCharts.pdf" );
} );
} );
}
}, {
label: "SVG",
click: function() {
this.capture( {}, function() {
this.toSVG( {}, function( data ) {
this.download( data, "text/xml", "amCharts.svg" );
} );
} );
}
}, {
label: "CSV",
click: function() {
this.toCSV( {}, function( data ) {
this.download( data, "text/plain", "amCharts.csv" );
} );
}
}, {
label: "JSON",
click: function() {
this.toJSON( {}, function( data ) {
this.download( data, "text/plain", "amCharts.json" );
} );
}
}, {
label: "XLSX",
click: function() {
this.toXLSX( {}, function( data ) {
this.download( data, "application/octet-stream", "amCharts.xlsx" );
} );
}
} ]
}
]
} ]
};

View file

@ -0,0 +1,84 @@
/**
* This is a sample chart export config file. It is provided as a reference on
* how miscelaneous items in export menu can be used and set up.
*
* You do not need to use this file. It contains default export menu options
* that will be shown if you do not provide any "menu" in your export config.
*
* Please refer to README.md for more information.
*/
/**
* PDF-specfic configuration
*/
AmCharts.exportPDF = {
"format": "PDF",
"content": [ "Saved from:", window.location.href, {
"image": "reference",
"fit": [ 523.28, 769.89 ] // fit image to A4
} ]
};
/**
* Print-specfic configuration
*/
AmCharts.exportPrint = {
"format": "PRINT",
"label": "Print"
};
/**
* Define main universal config
*/
AmCharts.exportCFG = {
"enabled": true,
"menu": [ {
"class": "export-main",
"label": "Export",
"menu": [ {
"label": "Download as ...",
"menu": [ "PNG", "JPG", "SVG", AmCharts.exportPDF ]
}, {
"label": "Save data ...",
"menu": [ "CSV", "XLSX", "JSON" ]
}, {
"label": "Annotate",
"action": "draw"
}, AmCharts.exportPrint ]
} ],
"drawing": {
"menu": [ {
"class": "export-drawing",
"menu": [ {
"label": "Add ...",
"menu": [ {
"label": "Shape ...",
"action": "draw.shapes"
}, {
"label": "Text",
"action": "text"
} ]
}, {
"label": "Change ...",
"menu": [ {
"label": "Mode ...",
"action": "draw.modes"
}, {
"label": "Color ...",
"action": "draw.colors"
}, {
"label": "Size ...",
"action": "draw.widths"
}, {
"label": "Opactiy ...",
"action": "draw.opacities"
}, "UNDO", "REDO" ]
}, {
"label": "Download as...",
"menu": [ "PNG", "JPG", "SVG", "PDF" ]
}, "PRINT", "CANCEL" ]
} ]
}
};

View file

@ -0,0 +1,80 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/funnel.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "funnel",
"dataProvider": [ {
"title": "Website visits",
"value": 200
}, {
"title": "Downloads",
"value": 123
}, {
"title": "Requested price list",
"value": 98
}, {
"title": "Contaced for more info",
"value": 72
}, {
"title": "Purchased",
"value": 35
}, {
"title": "Contacted for support",
"value": 35
}, {
"title": "Purchased additional products",
"value": 26
} ],
"balloon": {
"fixedPosition": true
},
"legend": {},
"valueField": "value",
"titleField": "title",
"marginRight": 240,
"marginLeft": 50,
"startX": -500,
"depth3D": 100,
"angle": 40,
"outlineAlpha": 1,
"outlineColor": "#FFFFFF",
"outlineThickness": 2,
"labelPosition": "right",
"balloonText": "[[title]]: [[value]]n[[description]]",
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,311 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/gantt.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
AmCharts.useUTC = true;
var chart = AmCharts.makeChart( "chartdiv", {
"type": "gantt",
"marginRight": 60,
"period": "hh",
"balloonDateFormat": "JJ:NN",
"columnWidth": 0.5,
"valueAxis": {
"type": "date",
"minimum": 7,
"maximum": 31
},
"brightnessStep": 10,
"graph": {
"fillAlphas": 1,
"balloonText": "<b>[[task]]</b>: [[open]] [[value]]"
},
"rotate": true,
"categoryField": "category",
"segmentsField": "segments",
"colorField": "color",
"startDate": "2015-01-01",
"startField": "start",
"endField": "end",
"durationField": "duration",
"dataProvider": [ {
"category": "John",
"segments": [ {
"start": 7,
"duration": 2,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 2,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Smith",
"segments": [ {
"start": 10,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 1,
"color": "#CF794A",
"task": "Task #3"
}, {
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
} ]
}, {
"category": "Ben",
"segments": [ {
"start": 12,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 16,
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Mike",
"segments": [ {
"start": 9,
"duration": 6,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 4,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Lenny",
"segments": [ {
"start": 8,
"duration": 1,
"color": "#CF794A",
"task": "Task #3"
}, {
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
} ]
}, {
"category": "Scott",
"segments": [ {
"start": 15,
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Julia",
"segments": [ {
"start": 9,
"duration": 2,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 1,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 8,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Bob",
"segments": [ {
"start": 9,
"duration": 8,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 7,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Kendra",
"segments": [ {
"start": 11,
"duration": 8,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 16,
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Tom",
"segments": [ {
"start": 9,
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 5,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Kyle",
"segments": [ {
"start": 6,
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Anita",
"segments": [ {
"start": 12,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 16,
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Jack",
"segments": [ {
"start": 8,
"duration": 10,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
} ]
}, {
"category": "Kim",
"segments": [ {
"start": 12,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 3,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Aaron",
"segments": [ {
"start": 18,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 2,
"color": "#FFE4C4",
"task": "Task #4"
} ]
}, {
"category": "Alan",
"segments": [ {
"start": 17,
"duration": 2,
"color": "#7B742C",
"task": "Task #1"
}, {
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 2,
"color": "#CF794A",
"task": "Task #3"
} ]
}, {
"category": "Ruth",
"segments": [ {
"start": 13,
"duration": 2,
"color": "#7E585F",
"task": "Task #2"
}, {
"duration": 1,
"color": "#CF794A",
"task": "Task #3"
}, {
"duration": 4,
"color": "#7B742C",
"task": "Task #1"
} ]
}, {
"category": "Simon",
"segments": [ {
"start": 10,
"duration": 3,
"color": "#7E585F",
"task": "Task #2"
}, {
"start": 17,
"duration": 4,
"color": "#FFE4C4",
"task": "Task #4"
} ]
} ],
"chartScrollbar": {},
"chartCursor": {
"valueBalloonsEnabled": false,
"cursorAlpha": 0.1,
"valueLineBalloonEnabled": true,
"valueLineEnabled": true,
"fullWidth": true
},
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,77 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/gauge.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "gauge",
"titles": [ {
"text": "Speedometer",
"size": 15
} ],
"axes": [ {
"startValue": 0,
"axisThickness": 1,
"endValue": 220,
"valueInterval": 10,
"bottomTextYOffset": -20,
"bottomText": "0 km/h",
"bands": [ {
"startValue": 0,
"endValue": 90,
"color": "#00CC00"
}, {
"startValue": 90,
"endValue": 130,
"color": "#ffac29"
}, {
"startValue": 130,
"endValue": 220,
"color": "#ea3838",
"innerRadius": "95%"
} ]
} ],
"arrows": [ {} ],
"export": {
"enabled": true
}
} );
setInterval( randomValue, 2000 );
// set random value
function randomValue() {
var value = Math.round( Math.random() * 200 );
chart.arrows[ 0 ].setValue( value );
chart.axes[ 0 ].setBottomText( value + " km/h" );
}
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,020 B

View file

@ -0,0 +1,63 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<style type="text/css">
iframe {
width: 900px;
height: 600px;
padding: 0;
border: 2px solid #ddd;
overflow: hidden;
position: relative;
}
#controls {
background: #ccc;
opacity: 0.5;
padding: 5px 8px;
font-size: 14px;
font-weight: bold;
font-family: Verdana;
margin-bottom: 10px;
}
</style>
<script type="text/javascript">
function setType( type ) {
$( '#iframe' ).attr( 'src', type );
}
function reload() {
setType( $( '#type' ).val() + "?" + Number( new Date() ) );
}
</script>
</head>
<body>
<div id="controls">
<select id="type" onchange="setType(this.options[this.selectedIndex].value);">
<option value="pie1.html" selected="selected">Pie #1 (Simple w/ legend)</option>
<option value="pie2.html"/>Pie #2 (3D w/ legend)</option>
<option value="pie3.html"/>Pie #3 (w/ ext. legend bottom)</option>
<option value="pie4.html"/>Pie #4 Multiple instances</option>
<option value="serial1.html">Serial #1 (Area)</option>
<option value="serial2.html">Serial #2 (Bar &amp; Line)</option>
<option value="serial3.html">Serial #3 (Line w/ zoom)</option>
<option value="xy.html">XY</option>
<option value="radar.html">Radar</option>
<option value="gauge.html">Gauge</option>
<option value="funnel.html">Funnel</option>
<option value="stock.html">Stock</option>
<option value="map.html">Map</option>
<option value="gantt.html">Gantt</option>
<option value="advanced.html">Advanced</option>
</select>
<input type="button" value="reload" onclick="reload();" />
</div>
<iframe id="iframe" src="pie1.html" frameborder="0"></iframe>
</body>
</html>

View file

@ -0,0 +1,209 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="http://www.amcharts.com/lib/3/ammap.js"></script>
<script src="http://www.amcharts.com/lib/3/maps/js/usaLow.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var map = AmCharts.makeChart( "chartdiv", {
"type": "map",
"colorSteps": 10,
"dataProvider": {
"map": "usaLow",
"areas": [ {
"id": "US-AL",
"value": 4447100
}, {
"id": "US-AK",
"value": 626932
}, {
"id": "US-AZ",
"value": 5130632
}, {
"id": "US-AR",
"value": 2673400
}, {
"id": "US-CA",
"value": 33871648
}, {
"id": "US-CO",
"value": 4301261
}, {
"id": "US-CT",
"value": 3405565
}, {
"id": "US-DE",
"value": 783600
}, {
"id": "US-FL",
"value": 15982378
}, {
"id": "US-GA",
"value": 8186453
}, {
"id": "US-HI",
"value": 1211537
}, {
"id": "US-ID",
"value": 1293953
}, {
"id": "US-IL",
"value": 12419293
}, {
"id": "US-IN",
"value": 6080485
}, {
"id": "US-IA",
"value": 2926324
}, {
"id": "US-KS",
"value": 2688418
}, {
"id": "US-KY",
"value": 4041769
}, {
"id": "US-LA",
"value": 4468976
}, {
"id": "US-ME",
"value": 1274923
}, {
"id": "US-MD",
"value": 5296486
}, {
"id": "US-MA",
"value": 6349097
}, {
"id": "US-MI",
"value": 9938444
}, {
"id": "US-MN",
"value": 4919479
}, {
"id": "US-MS",
"value": 2844658
}, {
"id": "US-MO",
"value": 5595211
}, {
"id": "US-MT",
"value": 902195
}, {
"id": "US-NE",
"value": 1711263
}, {
"id": "US-NV",
"value": 1998257
}, {
"id": "US-NH",
"value": 1235786
}, {
"id": "US-NJ",
"value": 8414350
}, {
"id": "US-NM",
"value": 1819046
}, {
"id": "US-NY",
"value": 18976457
}, {
"id": "US-NC",
"value": 8049313
}, {
"id": "US-ND",
"value": 642200
}, {
"id": "US-OH",
"value": 11353140
}, {
"id": "US-OK",
"value": 3450654
}, {
"id": "US-OR",
"value": 3421399
}, {
"id": "US-PA",
"value": 12281054
}, {
"id": "US-RI",
"value": 1048319
}, {
"id": "US-SC",
"value": 4012012
}, {
"id": "US-SD",
"value": 754844
}, {
"id": "US-TN",
"value": 5689283
}, {
"id": "US-TX",
"value": 20851820,
"description": "<p>Texas 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).</p>"
}, {
"id": "US-UT",
"value": 2233169
}, {
"id": "US-VT",
"value": 608827
}, {
"id": "US-VA",
"value": 7078515
}, {
"id": "US-WA",
"value": 5894121
}, {
"id": "US-WV",
"value": 1808344
}, {
"id": "US-WI",
"value": 5363675
}, {
"id": "US-WY",
"value": 493782
} ]
},
"areasSettings": {
"autoZoom": true
},
"smallMap": {
"top": 50,
"right": 50
},
"valueLegend": {
"right": 10,
"minValue": "little",
"maxValue": "a lot!"
},
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,72 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "pie",
"dataProvider": [ {
"country": "Czech Republic",
"litres": 156.9
}, {
"country": "Ireland",
"litres": 131.1
}, {
"country": "Germany",
"litres": 115.8
}, {
"country": "Australia",
"litres": 109.9
}, {
"country": "Austria",
"litres": 108.3
}, {
"country": "UK",
"litres": 65
}, {
"country": "Belgium",
"litres": 50
} ],
"titleField": "country",
"valueField": "litres",
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"innerRadius": "30%",
"legend": {
"position": "right",
"markerType": "circle"
},
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,97 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "pie",
"titles": [ {
"text": "Visitors countries",
"size": 16
} ],
"dataProvider": [ {
"country": "United States",
"visits": 7252
}, {
"country": "China",
"visits": 3882
}, {
"country": "Japan",
"visits": 1809
}, {
"country": "Germany",
"visits": 1322
}, {
"country": "United Kingdom",
"visits": 1122
}, {
"country": "France",
"visits": 414
}, {
"country": "India",
"visits": 384
}, {
"country": "Spain",
"visits": 211
} ],
"valueField": "visits",
"titleField": "country",
"startEffect": "elastic",
"startDuration": 2,
"labelRadius": 15,
"innerRadius": "50%",
"depth3D": 10,
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"angle": 15,
"legend": {
"position": "right"
},
"export": {
"enabled": true,
"menu": [ {
"class": "export-main",
"menu": [ {
"label": "Download",
"menu": [ "PNG", "JPG", "CSV" ]
}, {
"label": "Annotate",
"action": "draw",
"menu": [ {
"class": "export-drawing",
"menu": [ "PNG", "JPG", "CANCEL" ]
} ]
} ]
} ]
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,84 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 80%;
position: relative;
}
#legenddiv {
width: 100%;
height: 19%;
position: relative;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "pie",
"dataProvider": [ {
"country": "Czech Republic",
"litres": 156.9
}, {
"country": "Ireland",
"litres": 131.1
}, {
"country": "Germany",
"litres": 115.8
}, {
"country": "Australia",
"litres": 109.9
}, {
"country": "Austria",
"litres": 108.3
}, {
"country": "UK",
"litres": 65
}, {
"country": "Belgium",
"litres": 50
} ],
"titleField": "country",
"valueField": "litres",
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"innerRadius": "30%",
"legend": {
"align": "center",
"markerType": "circle",
"divId": "legenddiv"
},
"export": {
"enabled": true,
"position": "top-left",
"legend": {
"position": "bottom"
}
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
<div id="legenddiv"></div>
</body>
</html>

View file

@ -0,0 +1,101 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv, #chartdiv2 {
width: 50%;
height: 100%;
float: left;
position: relative;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "pie",
"dataProvider": [ {
"country": "Czech Republic",
"litres": 156.9
}, {
"country": "Ireland",
"litres": 131.1
}, {
"country": "Germany",
"litres": 115.8
}, {
"country": "Australia",
"litres": 109.9
}, {
"country": "Austria",
"litres": 108.3
}, {
"country": "UK",
"litres": 65
}, {
"country": "Belgium",
"litres": 50
} ],
"titleField": "country",
"valueField": "litres",
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"innerRadius": "30%",
"labelsEnabled": false,
"export": {
"enabled": true,
"libs": {
"path": "../libs/"
}
}
} );
var chart2 = AmCharts.makeChart( "chartdiv2", {
"type": "pie",
"pathToImages": "http://www.amcharts.com/lib/3/images/",
"dataProvider": [ {
"country": "Czech Republic",
"litres": 20
}, {
"country": "Ireland",
"litres": 30
}, {
"country": "Germany",
"litres": 15
}, {
"country": "Australia",
"litres": 10
} ],
"titleField": "country",
"valueField": "litres",
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"innerRadius": "30%",
"labelsEnabled": false,
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
<div id="chartdiv2"></div>
</body>
</html>

View file

@ -0,0 +1,92 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/radar.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "radar",
"dataProvider": [ {
"country": "Czech Republic",
"litres": 156.9,
"litres2": 182.1
}, {
"country": "Ireland",
"litres": 131.1,
"litres2": 129.2
}, {
"country": "Germany",
"litres": 115.8,
"litres2": 170.9
}, {
"country": "Australia",
"litres": 109.9,
"litres2": 120.1
}, {
"country": "Austria",
"litres": 108.3,
"litres2": 93.8
}, {
"country": "UK",
"litres": 99,
"litres2": 102
} ],
"categoryField": "country",
"startDuration": 2,
"valueAxes": [ {
"axisAlpha": 0.15,
"minimum": 0,
"dashLength": 3,
"axisTitleOffset": 20,
"gridCount": 5
} ],
"graphs": [ {
"valueField": "litres",
"title": "Litres (2014)",
"bullet": "round",
"lineThickness": 2,
"balloonText": "[[value]] litres of beer per year"
}, {
"valueField": "litres2",
"title": "Litres (2015)",
"bullet": "round",
"lineThickness": 2,
"balloonText": "[[value]] litres of beer per year"
} ],
"legend": {
"align": "center"
},
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,213 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<script src="export.config.default.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chartData = [ {
"year": 2000,
"cars": 1587,
"motorcycles": 650,
"bicycles": 121
}, {
"year": 1995,
"cars": 1567,
"motorcycles": 683,
"bicycles": 146
}, {
"year": 1996,
"cars": 1617,
"motorcycles": 691,
"bicycles": 138
}, {
"year": 1997,
"cars": 1630,
"motorcycles": 642,
"bicycles": 127
}, {
"year": 1998,
"cars": 1660,
"motorcycles": 699,
"bicycles": 105
}, {
"year": 1999,
"cars": 1683,
"motorcycles": 721,
"bicycles": 109
}, {
"year": 2000,
"cars": 1691,
"motorcycles": 737,
"bicycles": 112
}, {
"year": 2001,
"cars": 1298,
"motorcycles": 680,
"bicycles": 101
}, {
"year": 2002,
"cars": 1275,
"motorcycles": 664,
"bicycles": 97
}, {
"year": 2003,
"cars": 1246,
"motorcycles": 648,
"bicycles": 93
}, {
"year": 2004,
"cars": 1218,
"motorcycles": 637,
"bicycles": 101
}, {
"year": 2005,
"cars": 1213,
"motorcycles": 633,
"bicycles": 87
}, {
"year": 2006,
"cars": 1199,
"motorcycles": 621,
"bicycles": 79
}, {
"year": 2007,
"cars": 1110,
"motorcycles": 210,
"bicycles": 81
}, {
"year": 2008,
"cars": 1165,
"motorcycles": 232,
"bicycles": 75
}, {
"year": 2009,
"cars": 1145,
"motorcycles": 219,
"bicycles": 88
}, {
"year": 2010,
"cars": 1163,
"motorcycles": 201,
"bicycles": 82
}, {
"year": 2011,
"cars": 1180,
"motorcycles": 285,
"bicycles": 87
}, {
"year": 2012,
"cars": 1159,
"motorcycles": 277,
"bicycles": 71
} ];
var chart = AmCharts.makeChart( "chartdiv", {
"type": "serial",
"dataProvider": chartData,
"rotate": false,
"marginTop": 10,
"marginRight": 70,
"categoryField": "year",
"categoryAxis": {
"gridAlpha": 0.07,
"axisColor": "#DADADA",
"startOnAxis": false,
"title": "Year",
"guides": [ {
"category": "2001",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "fines for speeding increased"
}, {
"category": "2007",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "motorcycle maintenance fee introduced"
} ]
},
"valueAxes": [ {
"stackType": "regular",
"gridAlpha": 0.07,
"title": "Traffic incidents"
} ],
"graphs": [ {
"id": "g1",
"type": "column",
"title": "Cars",
"valueField": "cars",
"bullet": "round",
"lineAlpha": 0,
"fillAlphas": 0.6,
"balloonText": "<img src='images/car.png' style='vertical-align:bottom; margin-right: 10px; width:28px; height:21px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>"
}, {
"id": "g2",
"type": "column",
"title": "Motorcycles",
"valueField": "motorcycles",
"lineAlpha": 0,
"fillAlphas": 0.6,
"balloonText": "<img src='images/motorcycle.png' style='vertical-align:bottom; margin-right: 10px; width:28px; height:21px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>"
}, {
"id": "g3",
"type": "column",
"title": "Bicycles",
"valueField": "bicycles",
"lineAlpha": 0,
"fillAlphas": 0.6,
"balloonText": "<img src='images/bicycle.png' style='vertical-align:bottom; margin-right: 10px; width:28px; height:21px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>"
} ],
"legend": {
"position": "bottom",
"valueText": "[[value]]",
"valueWidth": 100,
"valueAlign": "left",
"equalWidths": false,
"periodValueText": "total: [[value.sum]]"
},
"chartCursor": {
"cursorAlpha": 0
},
"chartScrollbar": {
"color": "FFFFFF"
},
// this shows how externally included config file can be used
"export": AmCharts.exportCFG
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,112 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/themes/dark.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
background-color: #282828;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "serial",
"theme": "dark",
"dataProvider": [ {
"year": 2005,
"income": 23.5,
"expenses": 18.1
}, {
"year": 2006,
"income": 26.2,
"expenses": 22.8
}, {
"year": 2007,
"income": 30.1,
"expenses": 23.9
}, {
"year": 2008,
"income": 29.5,
"expenses": 25.1
}, {
"year": 2009,
"income": 24.6,
"expenses": 25
} ],
"categoryField": "year",
"startDuration": 1,
"rotate": true,
"categoryAxis": {
"gridPosition": "start"
},
"valueAxes": [ {
"position": "bottom",
"title": "Million USD",
"minorGridEnabled": true
} ],
"graphs": [ {
"type": "column",
"title": "Income",
"valueField": "income",
"fillAlphas": 1,
"balloonText": "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b></span>"
}, {
"type": "line",
"title": "Expenses",
"valueField": "expenses",
"lineThickness": 2,
"bullet": "round",
"balloonText": "<span style='font-size:13px;'>[[title]] in [[category]]:<b>[[value]]</b></span>"
} ],
"legend": {
"useGraphSettings": true
},
"creditsPosition": "top-right",
"export": {
"enabled": true,
"fileName": "exportedChart",
// set background color for exported image
"backgroundColor": "#282828",
// set column names when exporting as data
"exportTitles": true,
"columnNames": {
"year": "Year",
"income": "Income, USD",
"expenses": "Expenses, USD"
},
// change the dataProvider when exporting
"processData": function (data) {
return data.slice(1, -1);
}
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,112 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chartData = [];
generateChartData();
var chart = AmCharts.makeChart( "chartdiv", {
"type": "serial",
"marginTop": 30,
"dataProvider": chartData,
"categoryField": "date",
"categoryAxis": {
"parseDates": true,
"gridAlpha": 0.15,
"minorGridEnabled": true,
"axisColor": "#DADADA"
},
"valueAxes": [ {
"axisAlpha": 0.2,
"id": "v1"
} ],
"graphs": [ {
"title": "red line",
"id": "g1",
"valueAxis": "v1",
"valueField": "visits",
"bullet": "round",
"bulletBorderColor": "#FFFFFF",
"bulletBorderAlpha": 1,
"lineThickness": 2,
"lineColor": "#b5030d",
"negativeLineColor": "#0352b5",
"balloonText": "[[category]]<br><b><span style='font-size:14px;'>value: [[value]]</span></b>"
} ],
"chartCursor": {
"fullWidth": true,
"cursorAlpha": 0.1
},
"chartScrollbar": {
"scrollbarHeight": 40,
"color": "#FFFFFF",
"autoGridCount": true,
"graph": "g1"
},
"mouseWheelZoomEnabled": true,
"export": {
"enabled": true
}
} );
chart.addListener( "dataUpdated", zoomChart );
// generate some random data, quite different range
function generateChartData() {
var firstDate = new Date();
firstDate.setDate( firstDate.getDate() - 500 );
for ( var i = 0; i < 500; i++ ) {
// we create date objects here. In your data, you can have date strings
// and then set format of your dates using chart.dataDateFormat property,
// however when possible, use date objects, as this will speed up chart rendering.
var newDate = new Date( firstDate );
newDate.setDate( newDate.getDate() + i );
var visits = Math.round( Math.random() * 40 ) - 20;
chartData.push( {
date: newDate,
visits: visits
} );
}
}
// this method is called when chart is first inited as we listen for "dataUpdated" event
function zoomChart() {
// different zoom methods can be used - zoomToIndexes, zoomToDates, zoomToCategoryValues
chart.zoomToIndexes( chartData.length - 40, chartData.length - 1 );
}
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,223 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/amstock.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chartData1 = [];
var chartData2 = [];
var chartData3 = [];
var chartData4 = [];
generateChartData();
function generateChartData() {
var firstDate = new Date();
firstDate.setDate( firstDate.getDate() - 500 );
firstDate.setHours( 0, 0, 0, 0 );
for ( var i = 0; i < 500; i++ ) {
var newDate = new Date( firstDate );
newDate.setDate( newDate.getDate() + i );
var a1 = Math.round( Math.random() * ( 40 + i ) ) + 100 + i;
var b1 = Math.round( Math.random() * ( 1000 + i ) ) + 500 + i * 2;
var a2 = Math.round( Math.random() * ( 100 + i ) ) + 200 + i;
var b2 = Math.round( Math.random() * ( 1000 + i ) ) + 600 + i * 2;
var a3 = Math.round( Math.random() * ( 100 + i ) ) + 200;
var b3 = Math.round( Math.random() * ( 1000 + i ) ) + 600 + i * 2;
var a4 = Math.round( Math.random() * ( 100 + i ) ) + 200 + i;
var b4 = Math.round( Math.random() * ( 100 + i ) ) + 600 + i;
chartData1.push( {
date: newDate,
value: a1,
volume: b1
} );
chartData2.push( {
date: newDate,
value: a2,
volume: b2
} );
chartData3.push( {
date: newDate,
value: a3,
volume: b3
} );
chartData4.push( {
date: newDate,
value: a4,
volume: b4
} );
}
}
var chart = AmCharts.makeChart( "chartdiv", {
"type": "stock",
"dataSets": [ {
"title": "first data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData1,
"categoryField": "date"
},
{
"title": "second data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData2,
"categoryField": "date"
},
{
"title": "third data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData3,
"categoryField": "date"
},
{
"title": "fourth data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData4,
"categoryField": "date"
}
],
"panels": [ {
"showCategoryAxis": false,
"title": "Value",
"percentHeight": 70,
"stockGraphs": [ {
"id": "g1",
"valueField": "value",
"comparable": true,
"compareField": "value",
"balloonText": "[[title]]:<b>[[value]]</b>",
"compareGraphBalloonText": "[[title]]:<b>[[value]]</b>"
} ],
"stockLegend": {
"periodValueTextComparing": "[[percents.value.close]]%",
"periodValueTextRegular": "[[value.close]]"
}
},
{
"title": "Volume",
"percentHeight": 30,
"stockGraphs": [ {
"valueField": "volume",
"type": "column",
"showBalloon": false,
"fillAlphas": 1
} ],
"stockLegend": {
"periodValueTextRegular": "[[value.close]]"
}
}
],
"chartScrollbarSettings": {
"graph": "g1"
},
"chartCursorSettings": {
"valueBalloonsEnabled": true,
"fullWidth": true,
"cursorAlpha": 0.1,
"valueLineBalloonEnabled": true,
"valueLineEnabled": true,
"valueLineAlpha": 0.5
},
"periodSelector": {
"position": "left",
"periods": [ {
"period": "MM",
"selected": true,
"count": 1,
"label": "1 month"
}, {
"period": "YYYY",
"count": 1,
"label": "1 year"
}, {
"period": "YTD",
"label": "YTD"
}, {
"period": "MAX",
"label": "MAX"
} ]
},
"dataSetSelector": {
"position": "left"
},
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,139 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- AmCharts includes -->
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/xy.js"></script>
<!-- Export plugin includes and styles -->
<script src="../export.js"></script>
<link type="text/css" href="../export.css" rel="stylesheet">
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 11px;
font-family: Verdana;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script type="text/javascript">
var chart = AmCharts.makeChart( "chartdiv", {
"type": "xy",
"marginTop": 25,
"startDuration": 1.5,
"trendLines": [],
"graphs": [ {
"title": "Diamonds",
"balloonText": "x:<b>[[x]]</b> y:<b>[[y]]</b><br>value:<b>[[value]]</b>",
"bullet": "diamond",
"id": "AmGraph-1",
"lineAlpha": 0,
"lineColor": "#b0de09",
"valueField": "value",
"xField": "x",
"yField": "y"
}, {
"title": "Balls",
"balloonText": "x:<b>[[x]]</b> y:<b>[[y]]</b><br>value:<b>[[value]]</b>",
"bullet": "round",
"id": "AmGraph-2",
"lineAlpha": 0,
"lineColor": "#fcd202",
"valueField": "value2",
"xField": "x2",
"yField": "y2"
} ],
"guides": [ {
"fillAlpha": 0.3,
"fillColor": "#ff8000",
"id": "Guide-1",
"toValue": -2,
"value": -8,
"valueAxis": "ValueAxis-2"
} ],
"valueAxes": [ {
"id": "ValueAxis-1",
"axisAlpha": 0
}, {
"id": "ValueAxis-2",
"axisAlpha": 0,
"position": "bottom"
} ],
"allLabels": [],
"balloon": {},
"titles": [],
"dataProvider": [ {
"y": 10,
"x": 14,
"value": 59,
"y2": -5,
"x2": -3,
"value2": 44
}, {
"y": 5,
"x": 3,
"value": 50,
"y2": -15,
"x2": -8,
"value2": 12
}, {
"y": -10,
"x": -3,
"value": 19,
"y2": -4,
"x2": 6,
"value2": 35
}, {
"y": -6,
"x": 5,
"value": 65,
"y2": -5,
"x2": -6,
"value2": 168
}, {
"y": 15,
"x": -4,
"value": 92,
"y2": -10,
"x2": -8,
"value2": 102
}, {
"y": 13,
"x": 1,
"value": 8,
"y2": -2,
"x2": -3,
"value2": 41
}, {
"y": 1,
"x": 6,
"value": 35,
"y2": 0,
"x2": -3,
"value2": 16
} ],
"chartCursor": {},
"legend": {
"position": "bottom"
},
"export": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
require("amcharts3/amcharts/amcharts.js");
require("./export.min.js");

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "cs" ] = {
"fallback.save.text": "Stiskněte CTRL + C pro zkopírování dat do schránky.",
"fallback.save.image": "Klikněte pravým tlačítkem a zvolte Save picture as... k uložení obrázku.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Kliknutím zrušíte",
"menu.label.print": "Tisk",
"menu.label.undo": "Zpět",
"menu.label.redo": "Dopředu",
"menu.label.cancel": "Zrušit",
"menu.label.save.image": "Stáhnout obrázek ...",
"menu.label.save.data": "Stáhnout data ...",
"menu.label.draw": "Nakreslit ...",
"menu.label.draw.change": "Změnit ...",
"menu.label.draw.add": "Přidat ...",
"menu.label.draw.shapes": "Tvar ...",
"menu.label.draw.colors": "Barva ...",
"menu.label.draw.widths": "Velikost ...",
"menu.label.draw.opacities": "Průhlednost ...",
"menu.label.draw.text": "Text",
"menu.label.draw.modes": "Režim kreslení ...",
"menu.label.draw.modes.pencil": "Tužka",
"menu.label.draw.modes.line": "Čára",
"menu.label.draw.modes.arrow": "Šipka",
"label.saved.from": "Uloženo ze stránky: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "de" ] = {
"fallback.save.text": "CTRL + C um die Daten in die Zwischenablage zu kopieren.",
"fallback.save.image": "Rechtsklick -> Bild speichern unter... um das Bild zu speichern.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Klicken zum Abbrechen.",
"menu.label.print": "Drucken",
"menu.label.undo": "Rückgängig",
"menu.label.redo": "Wiederherstellen",
"menu.label.cancel": "Abbrechen",
"menu.label.save.image": "Herunterladen als ...",
"menu.label.save.data": "Speichern als ...",
"menu.label.draw": "Notieren ...",
"menu.label.draw.change": "Ändern ...",
"menu.label.draw.add": "Hinzufügen ...",
"menu.label.draw.shapes": "Form ...",
"menu.label.draw.colors": "Farbe ...",
"menu.label.draw.widths": "Größe ...",
"menu.label.draw.opacities": "Deckkraft ...",
"menu.label.draw.text": "Text",
"menu.label.draw.modes": "Modus...",
"menu.label.draw.modes.pencil": "Stift",
"menu.label.draw.modes.line": "Linie",
"menu.label.draw.modes.arrow": "Pfeil",
"label.saved.from": "Gespeichert von: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "en" ] = {
"fallback.save.text": "CTRL + C to copy the data into the clipboard.",
"fallback.save.image": "Rightclick -> Save picture as... to save the image.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Click to cancel",
"menu.label.print": "Print",
"menu.label.undo": "Undo",
"menu.label.redo": "Redo",
"menu.label.cancel": "Cancel",
"menu.label.save.image": "Download as ...",
"menu.label.save.data": "Save as ...",
"menu.label.draw": "Annotate ...",
"menu.label.draw.change": "Change ...",
"menu.label.draw.add": "Add ...",
"menu.label.draw.shapes": "Shape ...",
"menu.label.draw.colors": "Color ...",
"menu.label.draw.widths": "Size ...",
"menu.label.draw.opacities": "Opacity ...",
"menu.label.draw.text": "Text",
"menu.label.draw.modes": "Mode ...",
"menu.label.draw.modes.pencil": "Pencil",
"menu.label.draw.modes.line": "Line",
"menu.label.draw.modes.arrow": "Arrow",
"label.saved.from": "Saved from: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "es" ] = {
"fallback.save.text": "CTRL + C para copiar datos en el portapapeles.",
"fallback.save.image": "Botón derecho -> Guardar imagen como... para guardar la imagen.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Click para cancelar",
"menu.label.print": "Imprimir",
"menu.label.undo": "Deshacer",
"menu.label.redo": "Rehacer",
"menu.label.cancel": "Cancelar",
"menu.label.save.image": "Descargar como ...",
"menu.label.save.data": "Guardar como ...",
"menu.label.draw": "Anotar ...",
"menu.label.draw.change": "Cambiar ...",
"menu.label.draw.add": "Añadir ...",
"menu.label.draw.shapes": "Forma ...",
"menu.label.draw.colors": "Color ...",
"menu.label.draw.widths": "Tamaño ...",
"menu.label.draw.opacities": "Opacidad ...",
"menu.label.draw.text": "Texto",
"menu.label.draw.modes": "Modo ...",
"menu.label.draw.modes.pencil": "Lápiz",
"menu.label.draw.modes.line": "Linea",
"menu.label.draw.modes.arrow": "Flecha",
"label.saved.from": "Guardar desde: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "fr" ] = {
"fallback.save.text": "CTRL + C pour copier dans le presse-papier.",
"fallback.save.image": "Clic-droit -> Enregistrer sous... pour sauvegarder l'image.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Cliquez pour annuler",
"menu.label.print": "Imprimer",
"menu.label.undo": "Retour",
"menu.label.redo": "Refaire",
"menu.label.cancel": "Annuler",
"menu.label.save.image": "Téléchargez en ...",
"menu.label.save.data": "Sauvegarder en ...",
"menu.label.draw": "Annoter ...",
"menu.label.draw.change": "Changer le ...",
"menu.label.draw.add": "Ajouter ...",
"menu.label.draw.shapes": "Formes ...",
"menu.label.draw.colors": "Couleurs ...",
"menu.label.draw.widths": "Taille ...",
"menu.label.draw.opacities": "Opacité ...",
"menu.label.draw.text": "Texte",
"menu.label.draw.modes": "Mode ...",
"menu.label.draw.modes.pencil": "Crayon",
"menu.label.draw.modes.line": "Ligne",
"menu.label.draw.modes.arrow": "Flèche",
"label.saved.from": "Sauvé de la: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "hu" ] = {
"fallback.save.text": "CTRL + C az adatok vágólapra történő másolásához.",
"fallback.save.image": "Jobb egérgomb -> Save picture as... a kép mentéséhez.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Kattints a megszakításhoz",
"menu.label.print": "Nyomtatás",
"menu.label.undo": "Visszavon",
"menu.label.redo": "Mégis",
"menu.label.cancel": "Mégse",
"menu.label.save.image": "Kép mentése ...",
"menu.label.save.data": "Mentés másként ...",
"menu.label.draw": "Jegyzet ...",
"menu.label.draw.change": "Módosítás ...",
"menu.label.draw.add": "Hozzáadás ...",
"menu.label.draw.shapes": "Alakzat ...",
"menu.label.draw.colors": "Szín ...",
"menu.label.draw.widths": "Méret ...",
"menu.label.draw.opacities": "Átlátszóság ...",
"menu.label.draw.text": "Szöveg",
"menu.label.draw.modes": "Mód ...",
"menu.label.draw.modes.pencil": "Toll",
"menu.label.draw.modes.line": "Vonal",
"menu.label.draw.modes.arrow": "Nyíl",
"label.saved.from": "Mentve innen: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "it" ] = {
"fallback.save.text": "CTRL + C per copiare negli appunti.",
"fallback.save.image": "Tasto destro -> Salva immagine come... per salvare come immagine.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Clicca per annullare",
"menu.label.print": "Stampa",
"menu.label.undo": "Indietro",
"menu.label.redo": "Avanti",
"menu.label.cancel": "Annulla",
"menu.label.save.image": "Download come ...",
"menu.label.save.data": "Salva come ...",
"menu.label.draw": "Annota ...",
"menu.label.draw.change": "Modifica ...",
"menu.label.draw.add": "Aggiungi ...",
"menu.label.draw.shapes": "Forma ...",
"menu.label.draw.colors": "Colore ...",
"menu.label.draw.widths": "Dimensione ...",
"menu.label.draw.opacities": "Opacità ...",
"menu.label.draw.text": "Testo",
"menu.label.draw.modes": "Modalità ...",
"menu.label.draw.modes.pencil": "Matita",
"menu.label.draw.modes.line": "Linea",
"menu.label.draw.modes.arrow": "Freccia",
"label.saved.from": "Salvato da: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "ko" ] = {
"fallback.save.text": "CTRL + C 를 눌러 클립보드로 데이터를 복사합니다.",
"fallback.save.image": "마우스 오른쪽 클릭 -> 다른 이름으로 저장... 으로 이미지를 저장합니다.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "취소하려면 클릭",
"menu.label.print": "출력",
"menu.label.undo": "실행 취소",
"menu.label.redo": "다시 실행",
"menu.label.cancel": "취소",
"menu.label.save.image": "다운로드 ...",
"menu.label.save.data": "데이터로 저장 ...",
"menu.label.draw": "그리기",
"menu.label.draw.change": "바꾸기 ...",
"menu.label.draw.add": "삽입하기 ...",
"menu.label.draw.shapes": "모양 ...",
"menu.label.draw.colors": "색 변경 ...",
"menu.label.draw.widths": "크기 변경 ...",
"menu.label.draw.opacities": "투명도 변경 ...",
"menu.label.draw.text": "텍스트",
"menu.label.draw.modes": "모드 변경 ...",
"menu.label.draw.modes.pencil": "펜",
"menu.label.draw.modes.line": "선",
"menu.label.draw.modes.arrow": "화살표",
"label.saved.from": "에서 저장: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "lt" ] = {
"fallback.save.text": "Spauskite CTRL + C jei norite nukopijuoti paveiksliuką.",
"fallback.save.image": "Spragtelkite dešinį klavišą ir pasirinkite \"Save picture as...\" jei norite išsaugoti paveiksliuką.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Nutraukti",
"menu.label.print": "Spausdinti",
"menu.label.undo": "Atšaukti",
"menu.label.redo": "Pakartoti",
"menu.label.cancel": "Nutraukti",
"menu.label.save.image": "Atsisiųsti ...",
"menu.label.save.data": "Išsaugoti ...",
"menu.label.draw": "Anotuoti ...",
"menu.label.draw.change": "Keisti ...",
"menu.label.draw.add": "Pridėti ...",
"menu.label.draw.shapes": "Ikonėlę ...",
"menu.label.draw.colors": "Spalvą ...",
"menu.label.draw.widths": "Teptuką ...",
"menu.label.draw.opacities": "Nepermatomumas ...",
"menu.label.draw.text": "Tekstą",
"menu.label.draw.modes": "Režimas ...",
"menu.label.draw.modes.pencil": "Tekstą",
"menu.label.draw.modes.line": "Linija",
"menu.label.draw.modes.arrow": "Rodyklė",
"label.saved.from": "Išsaugoti nuo: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "pl" ] = {
"fallback.save.text": "Naciśnij CTRL + C by skopiować dane do schowka.",
"fallback.save.image": "Prawy przycisk myszy -> Zapisz obrazek jako... by zapisać obrazek.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Kliknij by anulować",
"menu.label.print": "Drukuj",
"menu.label.undo": "Cofnij",
"menu.label.redo": "Przywróć",
"menu.label.cancel": "Anuluj",
"menu.label.save.image": "Pobierz jako ...",
"menu.label.save.data": "Zapisz jako ...",
"menu.label.draw": "Rysuj ...",
"menu.label.draw.change": "Zmień ...",
"menu.label.draw.add": "Dodaj ...",
"menu.label.draw.shapes": "Kształt ...",
"menu.label.draw.colors": "Kolor ...",
"menu.label.draw.widths": "Rozmiar ...",
"menu.label.draw.opacities": "Przeźroczystość ...",
"menu.label.draw.text": "Tekst",
"menu.label.draw.modes": "Tryb ...",
"menu.label.draw.modes.pencil": "Ołówek",
"menu.label.draw.modes.line": "Linia",
"menu.label.draw.modes.arrow": "Strzałka",
"label.saved.from": "Ocalić od: "
}

View file

@ -0,0 +1,37 @@
/*
** Versão em Português
** Traduzido por Élton Reisdorfer
** WebSite: http://eltonrst.tk
** Facebook : http://facebook.com/elton.reisdorfer
*/
AmCharts.translations["export"]["pt"] = {
"fallback.save.text": "CTRL + C para copiar os dados para a área de transferência.",
"fallback.save.image": "Clique Direito -> Salvar imagem como... para salvar a imagem.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "Clique para cancelar",
"menu.label.print": "Imprimir",
"menu.label.undo": "Desfazer",
"menu.label.redo": "Refazer",
"menu.label.cancel": "Cancelar",
"menu.label.save.image": "Baixar Como",
"menu.label.save.data": "Salvar Como",
"menu.label.draw": "Editar",
"menu.label.draw.change": "Alterar",
"menu.label.draw.add": "Adicionar",
"menu.label.draw.shapes": "Forma",
"menu.label.draw.colors": "Cor",
"menu.label.draw.widths": "Tamanho",
"menu.label.draw.opacities": "Tranparência",
"menu.label.draw.text": "Texto",
"menu.label.draw.modes": "Ferramenta",
"menu.label.draw.modes.pencil": "Pincel",
"menu.label.draw.modes.line": "Linha",
"menu.label.draw.modes.arrow": "Seta",
"label.saved.from": "Salvar de: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "tr" ] = {
"fallback.save.text": "CTRL + C panoya veriyi kopyalamak için.",
"fallback.save.image": "Sağ tıkla -> Resim olarak kaydet... resim olarak kaydemek için.",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "İptal etmek için tıkla",
"menu.label.print": "Yazdır",
"menu.label.undo": "Geri al",
"menu.label.redo": "Yenile",
"menu.label.cancel": "İptal",
"menu.label.save.image": "Farklı kaydet ...",
"menu.label.save.data": "Farklı kaydet ...",
"menu.label.draw": "Açıklama ekle ...",
"menu.label.draw.change": "Düzenle ...",
"menu.label.draw.add": "Ekle ...",
"menu.label.draw.shapes": "Şekil ...",
"menu.label.draw.colors": "Renk ...",
"menu.label.draw.widths": "Boyut ...",
"menu.label.draw.opacities": "Saydamlık ...",
"menu.label.draw.text": "Yazı",
"menu.label.draw.modes": "Mod ...",
"menu.label.draw.modes.pencil": "Kalem",
"menu.label.draw.modes.line": "Çizgi",
"menu.label.draw.modes.arrow": "Ok işareti",
"label.saved.from": "Kayıt edildi: "
}

View file

@ -0,0 +1,31 @@
AmCharts.translations[ "export" ][ "zh" ] = {
"fallback.save.text": "CTRL + C 复制数据到剪贴板。",
"fallback.save.image": "Rightclick -> 保存图片为... 保存图片。",
"capturing.delayed.menu.label": "{{duration}}",
"capturing.delayed.menu.title": "点击以取消",
"menu.label.print": "打印",
"menu.label.undo": "撤销",
"menu.label.redo": "重做",
"menu.label.cancel": "取消",
"menu.label.save.image": "下载为 ...",
"menu.label.save.data": "保存为 ...",
"menu.label.draw": "注释 ...",
"menu.label.draw.change": "修改 ...",
"menu.label.draw.add": "添加 ...",
"menu.label.draw.shapes": "形状 ...",
"menu.label.draw.colors": "颜色 ...",
"menu.label.draw.widths": "大小 ...",
"menu.label.draw.opacities": "不透明度 ...",
"menu.label.draw.text": "文字",
"menu.label.draw.modes": "模式 ...",
"menu.label.draw.modes.pencil": "铅笔",
"menu.label.draw.modes.line": "线",
"menu.label.draw.modes.arrow": "箭头",
"label.saved.from": "保存自: "
}

View file

@ -0,0 +1,188 @@
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 1.3.2
* 2016-06-16 18:25:19
*
* By Eli Grey, http://eligrey.com
* License: MIT
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
*/
/*global self */
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs = saveAs || (function(view) {
"use strict";
// IE <10 is explicitly unsupported
if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
return;
}
var
doc = view.document
// only get URL when necessary in case Blob.js hasn't overridden it yet
, get_URL = function() {
return view.URL || view.webkitURL || view;
}
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
, can_use_save_link = "download" in save_link
, click = function(node) {
var event = new MouseEvent("click");
node.dispatchEvent(event);
}
, is_safari = /constructor/i.test(view.HTMLElement) || view.safari
, is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent)
, throw_outside = function(ex) {
(view.setImmediate || view.setTimeout)(function() {
throw ex;
}, 0);
}
, force_saveable_type = "application/octet-stream"
// the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to
, arbitrary_revoke_timeout = 1000 * 40 // in ms
, revoke = function(file) {
var revoker = function() {
if (typeof file === "string") { // file is an object URL
get_URL().revokeObjectURL(file);
} else { // file is a File
file.remove();
}
};
setTimeout(revoker, arbitrary_revoke_timeout);
}
, dispatch = function(filesaver, event_types, event) {
event_types = [].concat(event_types);
var i = event_types.length;
while (i--) {
var listener = filesaver["on" + event_types[i]];
if (typeof listener === "function") {
try {
listener.call(filesaver, event || filesaver);
} catch (ex) {
throw_outside(ex);
}
}
}
}
, auto_bom = function(blob) {
// prepend BOM for UTF-8 XML and text/* types (including HTML)
// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});
}
return blob;
}
, FileSaver = function(blob, name, no_auto_bom) {
if (!no_auto_bom) {
blob = auto_bom(blob);
}
// First try a.download, then web filesystem, then object URLs
var
filesaver = this
, type = blob.type
, force = type === force_saveable_type
, object_url
, dispatch_all = function() {
dispatch(filesaver, "writestart progress write writeend".split(" "));
}
// on any filesys errors revert to saving with object URLs
, fs_error = function() {
if ((is_chrome_ios || (force && is_safari)) && view.FileReader) {
// Safari doesn't allow downloading of blob urls
var reader = new FileReader();
reader.onloadend = function() {
var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
var popup = view.open(url, '_blank');
if(!popup) view.location.href = url;
url=undefined; // release reference before dispatching
filesaver.readyState = filesaver.DONE;
dispatch_all();
};
reader.readAsDataURL(blob);
filesaver.readyState = filesaver.INIT;
return;
}
// don't create more object URLs than needed
if (!object_url) {
object_url = get_URL().createObjectURL(blob);
}
if (force) {
view.location.href = object_url;
} else {
var opened = view.open(object_url, "_blank");
if (!opened) {
// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
view.location.href = object_url;
}
}
filesaver.readyState = filesaver.DONE;
dispatch_all();
revoke(object_url);
}
;
filesaver.readyState = filesaver.INIT;
if (can_use_save_link) {
object_url = get_URL().createObjectURL(blob);
setTimeout(function() {
save_link.href = object_url;
save_link.download = name;
click(save_link);
dispatch_all();
revoke(object_url);
filesaver.readyState = filesaver.DONE;
});
return;
}
fs_error();
}
, FS_proto = FileSaver.prototype
, saveAs = function(blob, name, no_auto_bom) {
return new FileSaver(blob, name || blob.name || "download", no_auto_bom);
}
;
// IE 10+ (native saveAs)
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
return function(blob, name, no_auto_bom) {
name = name || blob.name || "download";
if (!no_auto_bom) {
blob = auto_bom(blob);
}
return navigator.msSaveOrOpenBlob(blob, name);
};
}
FS_proto.abort = function(){};
FS_proto.readyState = FS_proto.INIT = 0;
FS_proto.WRITING = 1;
FS_proto.DONE = 2;
FS_proto.error =
FS_proto.onwritestart =
FS_proto.onprogress =
FS_proto.onwrite =
FS_proto.onabort =
FS_proto.onerror =
FS_proto.onwriteend =
null;
return saveAs;
}(
typeof self !== "undefined" && self
|| typeof window !== "undefined" && window
|| this.content
));
// `self` is undefined in Firefox for Android content script context
// while `this` is nsIContentFrameMessageManager
// with an attribute `content` that corresponds to the window
if (typeof module !== "undefined" && module.exports) {
module.exports.saveAs = saveAs;
} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) {
define("FileSaver.js", function() {
return saveAs;
});
}

View file

@ -0,0 +1,2 @@
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})}

View file

@ -0,0 +1,211 @@
/* Blob.js
* A Blob implementation.
* 2014-07-24
*
* By Eli Grey, http://eligrey.com
* By Devin Samarin, https://github.com/dsamarin
* License: X11/MIT
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
*/
/*global self, unescape */
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
plusplus: true */
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
(function (view) {
"use strict";
view.URL = view.URL || view.webkitURL;
if (view.Blob && view.URL) {
try {
new Blob;
return;
} catch (e) {}
}
// Internally we use a BlobBuilder implementation to base Blob off of
// in order to support older browsers that only have BlobBuilder
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
var
get_class = function(object) {
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
}
, FakeBlobBuilder = function BlobBuilder() {
this.data = [];
}
, FakeBlob = function Blob(data, type, encoding) {
this.data = data;
this.size = data.length;
this.type = type;
this.encoding = encoding;
}
, FBB_proto = FakeBlobBuilder.prototype
, FB_proto = FakeBlob.prototype
, FileReaderSync = view.FileReaderSync
, FileException = function(type) {
this.code = this[this.name = type];
}
, file_ex_codes = (
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
).split(" ")
, file_ex_code = file_ex_codes.length
, real_URL = view.URL || view.webkitURL || view
, real_create_object_URL = real_URL.createObjectURL
, real_revoke_object_URL = real_URL.revokeObjectURL
, URL = real_URL
, btoa = view.btoa
, atob = view.atob
, ArrayBuffer = view.ArrayBuffer
, Uint8Array = view.Uint8Array
, origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
;
FakeBlob.fake = FB_proto.fake = true;
while (file_ex_code--) {
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
}
// Polyfill URL
if (!real_URL.createObjectURL) {
URL = view.URL = function(uri) {
var
uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
, uri_origin
;
uri_info.href = uri;
if (!("origin" in uri_info)) {
if (uri_info.protocol.toLowerCase() === "data:") {
uri_info.origin = null;
} else {
uri_origin = uri.match(origin);
uri_info.origin = uri_origin && uri_origin[1];
}
}
return uri_info;
};
}
URL.createObjectURL = function(blob) {
var
type = blob.type
, data_URI_header
;
if (type === null) {
type = "application/octet-stream";
}
if (blob instanceof FakeBlob) {
data_URI_header = "data:" + type;
if (blob.encoding === "base64") {
return data_URI_header + ";base64," + blob.data;
} else if (blob.encoding === "URI") {
return data_URI_header + "," + decodeURIComponent(blob.data);
} if (btoa) {
return data_URI_header + ";base64," + btoa(blob.data);
} else {
return data_URI_header + "," + encodeURIComponent(blob.data);
}
} else if (real_create_object_URL) {
return real_create_object_URL.call(real_URL, blob);
}
};
URL.revokeObjectURL = function(object_URL) {
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
real_revoke_object_URL.call(real_URL, object_URL);
}
};
FBB_proto.append = function(data/*, endings*/) {
var bb = this.data;
// decode data to a binary string
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
var
str = ""
, buf = new Uint8Array(data)
, i = 0
, buf_len = buf.length
;
for (; i < buf_len; i++) {
str += String.fromCharCode(buf[i]);
}
bb.push(str);
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
if (FileReaderSync) {
var fr = new FileReaderSync;
bb.push(fr.readAsBinaryString(data));
} else {
// async FileReader won't work as BlobBuilder is sync
throw new FileException("NOT_READABLE_ERR");
}
} else if (data instanceof FakeBlob) {
if (data.encoding === "base64" && atob) {
bb.push(atob(data.data));
} else if (data.encoding === "URI") {
bb.push(decodeURIComponent(data.data));
} else if (data.encoding === "raw") {
bb.push(data.data);
}
} else {
if (typeof data !== "string") {
data += ""; // convert unsupported types to strings
}
// decode UTF-16 to binary string
bb.push(unescape(encodeURIComponent(data)));
}
};
FBB_proto.getBlob = function(type) {
if (!arguments.length) {
type = null;
}
return new FakeBlob(this.data.join(""), type, "raw");
};
FBB_proto.toString = function() {
return "[object BlobBuilder]";
};
FB_proto.slice = function(start, end, type) {
var args = arguments.length;
if (args < 3) {
type = null;
}
return new FakeBlob(
this.data.slice(start, args > 1 ? end : this.data.length)
, type
, this.encoding
);
};
FB_proto.toString = function() {
return "[object Blob]";
};
FB_proto.close = function() {
this.size = 0;
delete this.data;
};
return FakeBlobBuilder;
}(view));
view.Blob = function(blobParts, options) {
var type = options ? (options.type || "") : "";
var builder = new BlobBuilder();
if (blobParts) {
for (var i = 0, len = blobParts.length; i < len; i++) {
if (Uint8Array && blobParts[i] instanceof Uint8Array) {
builder.append(blobParts[i].buffer);
}
else {
builder.append(blobParts[i]);
}
}
}
var blob = builder.getBlob(type);
if (!blob.slice && blob.webkitSlice) {
blob.slice = blob.webkitSlice;
}
return blob;
};
var getPrototypeOf = Object.getPrototypeOf || function(object) {
return object.__proto__;
};
view.Blob.prototype = getPrototypeOf(new view.Blob());
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more