HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// This sample uses 3rd party Proj4js JavaScript library to transform coordinates
3
// See https://docs.anychart.com/Maps/Map_Projections to learn more.
4
5
var dataSet = anychart.data.set([
6
{id: "AU.CT", value: 15, title: "Australian Capital Territory"},
7
{id: "AU.VI", value: 23, title: "Victoria"},
8
{id: "AU.WA", value: 86, title: "Western Australia"},
9
{id: "AU.QL", value: 16, title: "Queensland"},
10
{id: "AU.NS", value: 32, title: "New South Wales"},
11
{id: "AU.NT", value: 64, title: "Northern Territory"},
12
{id: "AU.TS", value: 28, title: "Tasmania"},
13
{id: "AU.SA", value: 45, title: "South Australian"}
14
]);
15
16
var dataSetForSeries = dataSet.mapAs({id: "id"});
17
var map = anychart.map();
18
map.geoData(anychart.maps.australia);
19
20
var series = map.choropleth(dataSetForSeries);
21
22
// Get tooltip.
23
var tooltip = series.tooltip();
24
tooltip.background({
25
stroke: "#9E9E9E",
26
fill: "#616161 .8"
27
});
28
tooltip.fontColor("#BBDEFB");
29
30
map.title("Get and modify tooltip");
31
map.container("container");
32
map.draw();
33
});