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,28 @@
{
"name": "amcharts3-responsive",
"authors": [
"amCharts <contact@amcharts.com>"
],
"description": "amCharts V3 Responsive plugin",
"main": [
"responsive.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/responsive.git"
}
}

View file

@ -0,0 +1,71 @@
<!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 Responsive Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/funnel.js"></script>
<script src="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
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]]",
"responsive": {
"enabled": true
}
});
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,304 @@
<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/serial.js"></script>
<script src="http://www.amcharts.com/lib/3/gantt.js"></script>
<script src="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
#chartdiv {
width: 100%;
height: 100%;
}
</style>
<script>
AmCharts.useUTC = true;
var chart = AmCharts.makeChart( "chartdiv", {
"type": "gantt",
"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
},
"responsive": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,71 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
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": [{}],
"responsive": {
"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" style="width: 100%; height: 100%;"></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,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">
<title>amCharts Responsive Example</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/start/jquery-ui.css"rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<style>
.ui-resizable-helper {
border: 1px dotted gray;
}
.resizable {
display: block;
width: 800px;
height: 500px;
padding: 0;
border: 2px solid #ddd;
overflow: hidden;
position: relative;
}
iframe {
width: 100%;
height: 100%;
}
#controls {
background: #ccc;
opacity: 0.5;
padding: 5px 8px;
font-size: 14px;
font-weight: bold;
font-family: Verdana;
margin-bottom: 10px;
}
#dims {
background: #ddd;
color: #555;
padding: 5px 8px;
font-size: 14px;
font-family: Verdana;
width: 100px;
text-align: center;
}
.ui-resizable-se {
display: none!important;
}
</style>
<script>
$(function () {
$(".resizable").resizable({
animate: true,
animateEasing: 'swing',
animateDuration: 250,
resize: function( event, ui ) {
$('#dims').html(ui.size.width+'x'+ui.size.height+'px');
}
});
});
function setType (type) {
$('#iframe').attr('src', type);
}
function reload() {
setType($('#type').val());
}
function resize( dim, dir) {
var container = $('.resizable');
if ( 'w' == dim )
container.css({ 'width': container.width() + dir});
else
container.css({ 'height': container.height() + dir});
$('#dims').html(container.width()+'x'+container.height()+'px');
}
</script>
</head>
<body>
<div id="controls">
<input type="button" value="w-" onclick="resize('w', -50);" />
<input type="button" value="w+" onclick="resize('w', 50);" />
<input type="button" value="h-" onclick="resize('h', -50);" />
<input type="button" value="h+" onclick="resize('h', 50);" />
<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 (several 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="gantt.html">GANTT</option>
<option value="stock.html">Stock</option>
<option value="map.html">Map</option>
</select>
<input type="button" value="reload" onclick="reload();" />
</div>
<div id="dims">800x500px</div>
<div class="resizable">
<iframe id="iframe" src="pie1.html" sytle="border: none; width: 100%; height: 100%;" frameborder="0"></iframe>
</div>
</body>
</html>

View file

@ -0,0 +1,198 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
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": {},
"valueLegend": {
"right": 10,
"minValue": "little",
"maxValue": "a lot!"
},
"responsive": {
"enabled": true
}
});
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,71 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
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"
},
"responsive": {
"enabled": true,
"addDefaultRules": true,
"rules": [
{
"minWidth": 500,
"overrides": {
"innerRadius": "50%",
}
}
]
}
});
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,73 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
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"
},
"responsive": {
"enabled": true
}
});
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,106 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
.chartdiv {
width: 50%;
height: 100%;
float: left;
}
</style>
<script>
AmCharts.makeChart( "chart1", {
"type": "pie",
"titles": [ {
"text": "Visits",
"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
} ],
"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": {},
"responsive": {
"enabled": true
}
} );
AmCharts.makeChart( "chart2", {
"type": "pie",
"theme": "none",
"titles": [ {
"text": "Views",
"size": 16
} ],
"dataProvider": [ {
"country": "United States",
"visits": 10616
}, {
"country": "China",
"visits": 9845
}, {
"country": "Japan",
"visits": 3111
}, {
"country": "Germany",
"visits": 2874
}, {
"country": "United Kingdom",
"visits": 2110
} ],
"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": {},
"responsive": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chart1" class="chartdiv"></div>
<div id="chart2" class="chartdiv"></div>
</body>
</html>

View file

@ -0,0 +1,67 @@
<!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 Responsive Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/radar.js"></script>
<script src="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "radar",
"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": 99
}],
"categoryField": "country",
"startDuration": 2,
"valueAxes": [{
"axisAlpha": 0.15,
"minimum": 0,
"dashLength": 3,
"axisTitleOffset": 20,
"gridCount": 5
}],
"graphs": [{
"valueField": "litres",
"title": "Litres",
"bullet": "round",
"balloonText": "[[value]] litres of beer per year"
}],
"legend": {},
"responsive": {
"enabled": true
}
});
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,203 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
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
}];
AmCharts.makeChart("chartdiv", {
"type": "serial",
"dataProvider": chartData,
"rotate": false,
"marginTop": 10,
"categoryField": "year",
"categoryAxis": {
"gridAlpha": 0.07,
"axisColor": "#DADADA",
"startOnAxis": true,
"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,
"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"
},
"responsive": {
"enabled": true
}
});
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,84 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
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": "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
}
});
</script>
</head>
<body style="background-color:#282828;">
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,103 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
var chartData = [];
generateChartData();
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"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,
"responsive": {
"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" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,210 @@
<!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 Responsive 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="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
font-family: Verdana;
font-size: 12px;
}
</style>
<script>
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",
"theme": "none",
"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"
},
"responsive": {
"enabled": true
}
} );
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

@ -0,0 +1,145 @@
<!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 Responsive Example</title>
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/xy.js"></script>
<script src="../responsive.min.js"></script>
<style>
body, html {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<script>
var chart = AmCharts.makeChart("chartdiv", {
"type": "xy",
"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"
},
"responsive": {
"enabled": true
}
});
</script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
</body>
</html>

View file

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

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-responsive",
"version": "1.0.5",
"license": "SEE LICENSE IN LICENSE",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/amcharts/responsive.git"
}
}

View file

@ -0,0 +1,372 @@
# amCharts Responsive
Version: 1.0.5
## Description
Use this plugin to enable "responsive" features for amCharts' JavaScript Charts,
JavaScript Stock Chart, or JavaScript Maps.
"Responsive" chart or map will modify it's features dynamically (even as you
resize the container) based on the available area. For example: a full fledged
line chart with legend guides, labels, titles and other elements will be
displayed in all its glory if container is big enough.
If the container shrinks (i.e. you resize a browser window or view it on an
iPad), it starts "compacting" the chart. First the legend is removed. Shrink it
even further, axis titles are removed and its value labels are moved inside the
plot area. Going even smaller, bullets, labels gone. All the way to the
sparkline representation of the chart.
Plugin brings a universal set of pre-defined rules that you can use to instantly
enable responsiveness. Those are custom-tailored for each chart/map type and
will probably fit your requirements out-of the-box. All you need to do is to
enable "responsive" plugin for your chart instance.
You can modify those defaults rules, or make your own list. The plugin allows
that. (see further down this file for instructions)
## Usage
1. Include the minified version of file of this plugin. I.e.:
```
<script src="amcharts/plugins/responsive/responsive.min.js" type="text/javascript"></script>
```
(this needs to go after all the other amCharts includes)
2. Add the following setting to your chart configuration:
```
AmCharts.makeChart( "chartdiv", {
...,
"responsive": {
"enabled": true
}
} );
```
Or if you are using non-JSON setup:
```
chart.responsive = {
"enabled": true
};
```
That's it.
## Advanced use
### Rules
You can modify (or completely overwrite) the default responsive rules used by
the plugin.
A plugin works by checking chart area dimensions after each resize. (or after
initial build / mobile device orientation change) It then overrides particular
settings suitable for these particular dimensions.
Override rules are implemented by defining chart rules, or just "rules" moving
forward. Each rule has two things:
1. Dimension conditions;
2. Overrides. (a set of properties to override for this particular rule)
A rule is an object, for example:
```
{
"minWidth": 200,
"maxWidth": 400,
"maxHeight": 400,
"minHeight": 200,
"overrides": {
"precision": 2,
"legend": {
"enabled": false
},
"valueAxes": {
"inside": true
}
}
}
```
The above rule will be applicable to a chart that is between 200px and 400px in
width and height.
It is not necessary to add all of the dimensional properties. You just neat at
least one.
So for example to make the rule apply to all charts with width 400px or lower,
you would do something like this:
```
{
"maxWidth": 400,
"overrides": {
"precision": 2,
"legend": {
"enabled": false
},
"valueAxes": {
"inside": true
}
}
}
```
Please note that there are several other conditional properties besides the ones
that deal with chart's dimensions:
* "rotate" (true|false) - set this property if you want to make this rule
applicable to rotated serial chart only (i.e. bar chart)
* "legendPosition" ("top|bottom|left|right") - set this property if you want the
rule applied only when the chart legend is set to particular position.
Please note that this does not check whether the legend is enabled at all.
Now, on to explaining "overrides". It's an object, that contains properties that
you want to override the chart's initial ones with.
It can be either simple properties, like "fontSize" or "precision", or complext
types like object, or array.
To override a property of a child object, such as "legend", you would simply go
with JSON representation of the properties you need to override. I.e.:
```
"legend": {
"enabled": false
}
```
This will look for a "legend" property in chart object, then change it's
"enabled" property to false.
### Overriding arrays of objects
Some objects in charts are collected in arrays, i.e. "graphs", "valueAxes", etc.
There are some ways to override their properties as well.
To override properties for ALL objects in the array, you would provide an
override instruction as an object. I.e.:
```
"graphs": {
"bullet": "round",
"lineThickness": 5
}
```
The above will add a round bullet and set line thickness to all of the graphs on
the chart.
You can also target individual items in the array. There are two ways to do
that:
a) Use "id" property;
b) Apply using the same index.
To individually apply property overrides, you will need to supply override
instructions as an array:
```
"graphs": [
{
"id": "g1",
"bullet": "round",
"lineThickness": 5
}
]
```
The above will apply the same properties for the graph with an id of "g1" only.
It will not touch the rest of the graphs.
Please note that original graph definition in your chart settings needs to have
the "id" property set so this plugin can target it.
Or you can omit the "id" and just apply overrides in the same order as you have
them defined. I.e.:
```
"graphs": [
{
"bullet": "round"
},
{
"bullet": "square"
}
]
```
The above will apply round bullets to the first defined graph, and square
bullets to the second graph.
### Chaining multiple rules
The cool pat is that you can daisy-chain the override rules, much like in CSS.
The plugin will examine all of the rules if their dimensional conditions match
current chart condition and will apply their overrides in the same order they
are defined.
Consider this rule set:
```
"responsive": {
"enabled": true,
"rules": [
// at 400px wide, we hide legend
{
"maxWidth": 400,
"overrides": {
"legend": {
"enabled"
}
}
},
// at 300px or less, we move value axis labels inside plot area
// the legend is still hidden because the above rule is still applicable
{
"maxWidth": 300,
"overrides": {
"valueAxes": {
"inside": true
}
}
},
// at 200 px we hide value axis labels altogether
{
"maxWidth": 200,
"overrides": {
"valueAxes": {
"labelsEnabled": false
}
}
}
]
}
```
In case several rules modify the same property, the last one will always "win".
### Combining custom rules with pre-defined ones
The plugin will combine your custom rules with pre-defined ones automatically.
In case you want to go pure and set only your own responsive rules, you can set
property "addDefaultRules" to false. I.e.:
```
"responsive": {
"enabled": true,
"addDefaultRules": false,
"rules": [
{
"maxWidth": 400,
"overrides": {
"legend": {
"enabled"
}
}
}
]
}
```
When your custom rules are combined with pre-defined ones, yours are appended at
the end of the list. This means that your rules will always have the "last
word".
## Requirements
This plugin requires at least 3.13 version of JavaScript Charts, JavaScript
Stock Chart or JavaScript Maps.
Any older versions will be ignored by this plugin. The charts will function but
no responsive rules will be applied to them.
## Demos
Run the index.html in the subdirectory /examples. It will allow viewing misc
chart types at various resolutions.
## 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/responsive
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.5
* Fixed an issue where Responsive plugin was disabling initial animations.
### 1.0.4
* Fixed errors when legend was `null` (thanks Hasan Akgün)
### 1.0.3
* Fixed issue with Stock Chart when Period Selector and Data Set Selector were turned off
### 1.0.2
* Fixed a bug where the plugin was causing an error when chart/map container was being hidden
### 1.0.1
* Fixed bug with overrides being overwritten with chart object in some cases
* V3.14 compatibility
### 1.0
* Added support for GANTT chart type (available sin JavaScript Charts V3.14)
### 0.9.2
* Fixed a custom rules being applied in the wrong order
### 0.9.1
* Made all examples use minified version of the plugin
* Introduced removal of grid lines on micro charts
* Tweaked legend hiding dimensions for pie chart
### 0.9
* Initial release

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