Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
123 changes: 121 additions & 2 deletions Test.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
<title>Test</title>
</head>
<body>

<h1>Climate Change Map</h1>
<div id="chartdiv"></div>
<button>generate</button>
</body>
</html>
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/maps.js"></script>
<script src="https://cdn.amcharts.com/lib/4/geodata/worldLow.js"></script>
<script src="https://cdn.amcharts.com/lib/4/geodata/data/countries2.js"></script>
<script src="https://cdn.amcharts.com/lib/4/themes/animated.js"></script>
<script>
var data = null;

Expand All @@ -23,4 +30,116 @@
xhr.setRequestHeader("authorization", "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJwcm9kLXVzZXItY2xpZW50OnpkaWV0ejI4IiwiaXNzIjoiYWdlbnQ6emRpZXR6Mjg6Ojk4YTNkZDY0LWJlMzAtNDczMi04NDZlLTFkNGNkYWNhYmIzZCIsImlhdCI6MTYwMTc0MDk4Nywicm9sZSI6WyJ1c2VyX2FwaV9yZWFkIiwidXNlcl9hcGlfd3JpdGUiXSwiZ2VuZXJhbC1wdXJwb3NlIjp0cnVlLCJzYW1sIjp7fX0.-FozIilkZ9bNshUIq-uDUgL_2nNNhnerKE2bJEdqz47yka0w1hxlFqyN3wPoJlMWsqQNMrmRNRilkXj5iBbdGQ");

xhr.send(data);
</script>

function Country(name, color)
{
this.name = name;
this.color = color;
}

Country.prototype.setColor = function(color){
this.color = color;
}

am4core.ready(function() {

// Themes begin
am4core.useTheme(am4themes_animated);
// Themes end

var continents = {
"AF": 0,
"AN": 1,
"AS": 2,
"EU": 3,
"NA": 4,
"OC": 5,
"SA": 6
}

// Create map instance
var chart = am4core.create("chartdiv", am4maps.MapChart);
chart.projection = new am4maps.projections.Miller();

// Create map polygon series for world map
var worldSeries = chart.series.push(new am4maps.MapPolygonSeries());
worldSeries.useGeodata = true;
worldSeries.geodata = am4geodata_worldLow;
worldSeries.exclude = ["AQ"];

var worldPolygon = worldSeries.mapPolygons.template;
worldPolygon.tooltipText = "{name}";
worldPolygon.nonScalingStroke = true;
worldPolygon.strokeOpacity = 0.5;
worldPolygon.fill = am4core.color("#eee");
worldPolygon.propertyFields.fill = "color";

var hs = worldPolygon.states.create("hover");
hs.properties.fill = chart.colors.getIndex(9);


// Create country specific series (but hide it for now)
var countrySeries = chart.series.push(new am4maps.MapPolygonSeries());
countrySeries.useGeodata = true;
countrySeries.hide();
countrySeries.geodataSource.events.on("done", function(ev) {
worldSeries.hide();
countrySeries.show();
});

var countryPolygon = countrySeries.mapPolygons.template;
countryPolygon.tooltipText = "{name}";
countryPolygon.nonScalingStroke = true;
countryPolygon.strokeOpacity = 0.5;
countryPolygon.fill = am4core.color("#eee");

var hs = countryPolygon.states.create("hover");
hs.properties.fill = chart.colors.getIndex(9);

// Set up click events
worldPolygon.events.on("hit", function(ev) {
ev.target.series.chart.zoomToMapObject(ev.target);
var map = ev.target.dataItem.dataContext.map;
if (map) {
ev.target.isHover = false;
countrySeries.geodataSource.url = "https://www.amcharts.com/lib/4/geodata/json/" + map + ".json";
countrySeries.geodataSource.load();
}
});

// Set up data for countries
var data = [];
for(var id in am4geodata_data_countries2) {
if (am4geodata_data_countries2.hasOwnProperty(id)) {
var country = am4geodata_data_countries2[id];
if (country.maps.length) {
data.push({
id: id,
color: chart.colors.getIndex(continents[country.continent_code]),
map: country.maps[0]
});
}
}
}
worldSeries.data = data;

// Zoom control
chart.zoomControl = new am4maps.ZoomControl();

var homeButton = new am4core.Button();
homeButton.events.on("hit", function() {
worldSeries.show();
countrySeries.hide();
chart.goHome();
});

homeButton.icon = new am4core.Sprite();
homeButton.padding(7, 5, 7, 5);
homeButton.width = 30;
homeButton.icon.path = "M16,8 L14,8 L14,16 L10,16 L10,10 L6,10 L6,16 L2,16 L2,8 L0,8 L8,0 L16,8 Z M16,8";
homeButton.marginBottom = 10;
homeButton.parent = chart.zoomControl;
homeButton.insertBefore(chart.zoomControl.plusButton);

}); // end am4core.ready()
</script>
3,441 changes: 3,441 additions & 0 deletions amcharts4/CHANGELOG.md

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions amcharts4/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Free amCharts license

This amCharts software is copyrighted by Antanas Marcelionis.

This amCharts software is provided under linkware license, conditions of which are outlined below.

### You can

* Use amCharts software in any of your projects, including commercial.
* Modify amCharts software to suit your needs (source code is available at [here](https://github.com/amcharts/amcharts4)).
* Bundle amCharts software with your own projects (free, open source, or commercial).

### If the following conditions are met

* You do not disable, hide or alter the branding link which is displayed on all the content generated by amCharts software unless you provide some other adequately prominent attribution to amCharts.
* You include this original LICENSE file together with original (or modified) files from amCharts software.
* Your own personal license does not supersede or in any way negate the effect of this LICENSE, or make the impression of doing so.

### You can't

* Remove or alter this LICENSE file.
* Remove any of the amCharts copyright notices from any of the files of amCharts software.
* Use amCharts software without any kind of prominent attribution (bundled or custom). Please see note about commercial amCharts licenses below.
* Sell or receive any consideration for amCharts software.
* Distribute amCharts software on its own, not as part of other application.

### The above does not suit you?

amCharts provides commercial licenses for purchase for various usage scenarios that are not covered by the above conditions.

Please refer to [this web page](https://www.amcharts.com/online-store/) or [contact amCharts support](mailto:contact@amcharts.com) for further information.

### In doubt?

[Contact amCharts](mailto:contact@amcharts.com). We'll be happy to sort you out.
23 changes: 23 additions & 0 deletions amcharts4/LICENSE-3RD-PARTY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 3rd-party libraries used in amCharts 4

## Used in Core package

|Package|Copyright (c)|License|
|-------|-------------|-------|
|canvg|Gabe Lerner|[License](https://github.com/canvg/canvg/blob/master/LICENSE)|
|d3-geo|Mike Bostock|[License](https://github.com/d3/d3-geo/blob/master/LICENSE)|
|d3-geo-projection|Mike Bostock|[License](https://github.com/d3/d3-geo-projection/blob/master/LICENSE)|
|pdfmake|bpampuch|[License](https://github.com/bpampuch/pdfmake/blob/master/LICENSE)|
|Fabric|Printio (Juriy Zaytsev, Maxim Chernyak)|[License](https://github.com/fabricjs/fabric.js/blob/master/LICENSE)|
|polylabel|Mapbox|[License](https://github.com/mapbox/polylabel/blob/master/LICENSE)|
|SheetJS js-xlsx|SheetJS LLC|[License](https://github.com/SheetJS/js-xlsx/blob/master/LICENSE)|
|tslib|Microsoft|[License](https://github.com/microsoft/tslib/blob/master/LICENSE.txt)|


## Used in optional plugins

|Package|Copyright (c)|License|
|-------|-------------|-------|
|d3-force|Mike Bostock|[License](https://github.com/d3/d3-force/blob/master/LICENSE)|
|regression-js|Tom Alexander|[License](https://github.com/Tom-Alexander/regression-js/blob/master/LICENSE)|
|venn.js|Ben Frederickson|[License](https://github.com/benfred/venn.js/blob/master/LICENSE)
96 changes: 96 additions & 0 deletions amcharts4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
## amCharts 4

You are now in possession of amCharts 4 - the most advanced JavaScript dataviz
library ever.

For a short overview of features, visit [this page](https://www.amcharts.com/javascript-charts/).


### Important notice about support

amCharts support is guaranteed for commercial license holders and amPlus
subscribers. GitHub issues is not usually monitored by amCharts support
staff and may not be answered. If you do have a license/subscription, you
may [contact us directly](https://www.amcharts.com/support/support-info/priority-support/)
for support. If you don't, here are
[a few options](https://www.amcharts.com/support/support-info/free-support/)
for you.


### Contents

|Directory|Description|
|---------|-----------|
|/|Root directory containing library files and related files|
|/deps/|3rd party libraries and other dependencies|
|/examples/|Collection of working examples|
|/lang/|Translation files / locales|
|/themes/|Theme files|


### Documentation

For extensive documentation, including getting started tutorials, as well
as class reference visit [V4 documentation website](https://www.amcharts.com/docs/v4).


### Other ways to get amCharts 4

* [NPM package](https://www.npmjs.com/package/@amcharts/amcharts4)
* [GitHub repository](https://github.com/amcharts/amcharts4)
* [ZIP download & CDN info](https://www.amcharts.com/download/)


### CDN

Copy of the contents of this package is available as a free CDN service,
accessible via URL `https://www.amcharts.com/lib/4/...`, e.g.:

```
<script src="https://www.amcharts.com/lib/4/core.js"></script>
<script src="https://www.amcharts.com/lib/4/charts.js"></script>
<script src="https://www.amcharts.com/lib/4/themes/animated.js"></script>
```


### Related packages

This package inlcudes `MapChart` (geographical maps) functionality. However,
it does not include geodata itself (map files) needed to instantiate the maps.

Those are available via separate package:

* [NPM package](https://www.npmjs.com/package/@amcharts/amcharts4-geodata)
* [GitHub repository (geodata)](https://github.com/amcharts/amcharts4-geodata)
* [ZIP download](https://www.amcharts.com/download/download-v4/)


### License

If you have a commercial amCharts 4 license, this software is covered by your
license, which supersedes any other license bundled with this package.

If you don't have a commercial license, the use of this software is covered by
a freeware license. Refer to included LICENSE file. The license is also
[available online](https://github.com/amcharts/amcharts4/blob/master/dist/script/LICENSE).


### Making translations

Please refer to [this tutorial](https://www.amcharts.com/docs/v4/tutorials/creating-translations/).


### Changelog

* [amCharts 4 Changelog](https://github.com/amcharts/amcharts4/blob/master/dist/script/CHANGELOG.md)
* [Documentation Changelog](https://www.amcharts.com/docs/v4/changelog/)


### Questions?

[Contact amCharts](mailto:contact@amcharts.com).


### Found a bug?

Open an [issue](https://github.com/amcharts/amcharts4/issues).
21 changes: 21 additions & 0 deletions amcharts4/charts.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions amcharts4/charts.js.map

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions amcharts4/core.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions amcharts4/core.js.map

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions amcharts4/deps/canvg.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions amcharts4/deps/canvg.js.map

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions amcharts4/deps/pdfmake.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions amcharts4/deps/pdfmake.js.map

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions amcharts4/deps/xlsx.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions amcharts4/deps/xlsx.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Steps to use
============

1. Open `index.html` in a browser
12 changes: 12 additions & 0 deletions amcharts4/examples/javascript/100%-stacked-column-chart/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
background-color: #ffffff;
overflow: hidden;
margin: 0;
}

#chartdiv {
width: 100%;
max-height: 600px;
height: 100vh;
}
15 changes: 15 additions & 0 deletions amcharts4/examples/javascript/100%-stacked-column-chart/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>amCharts V4 Example - 100%-stacked-column-chart</title>
<link rel="stylesheet" href="index.css" />
</head>
<body>
<div id="chartdiv"></div>
<script src="../../../core.js"></script>
<script src="../../../charts.js"></script>
<script src="../../../themes/animated.js"></script>
<script src="index.js"></script>
</body>
</html>
Loading