HTMLcopy
1
<button onclick="xml()">XML</button>
2
<button onclick="json()">JSON</button>
3
<div id="container"></div>
CSScopy
15
1
html, body {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
7
button {
8
margin: 10px 0 0 10px;
9
}
10
#container {
11
position: absolute;
12
width: 100%;
13
top: 35px;
14
bottom: 0;
15
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
3
// data
4
var data = [
5
["Winter", 5],
6
["Spring", 2],
7
["Summer", 2],
8
["Autumn", 1]
9
];
10
11
// set chart type
12
chart = anychart.line(data);
13
14
// set chart title
15
chart.title("Export Configuration Sample");
16
17
// set chart container and draw
18
chart.container("container").draw();
19
});
20
21
// save chart data and configuration in xml format
22
function xml() {
23
chart.saveAsXml("pancakes_chart_xml");
24
};
25
26
// save chart data and configuration in json format
27
function json() {
28
chart.saveAsJson("pancakes_chart_json");
29
};