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
26
1
anychart.onDocumentReady(function () {
2
svgString = "<svg xmlns='https://www.w3.org/2000/svg'>" +
3
"<g>" +
4
"<circle id='Seat 1' cx='50' cy='50' r='20'></circle>" +
5
"<circle id='Seat 2' cx='100' cy='50' r='20'></circle>" +
6
"<circle id='Seat 3' cx='150' cy='50' r='20'></circle>" +
7
"</g></svg>";
8
9
var chart = anychart.seatMap();
10
11
// Set data as an SVG string.
12
chart.geoData(svgString);
13
// set the title
14
chart.title("Load SVG from a string");
15
16
seatmap = chart.choropleth([
17
{id: "Seat 1", value: "$10"},
18
{id: "Seat 2", value: "$10"}
19
]);
20
21
chart.title("Set Seat Map Source as an SVG string.");
22
seatmap.tooltip().title("Description");
23
24
chart.container("container");
25
chart.draw();
26
});