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
// create data
3
var data = [
4
["January", 10000],
5
["February", 12000],
6
["March", 18000],
7
["April", 11000],
8
["May", 9000]
9
];
10
11
// set the chart type
12
var chart = anychart.area(data);
13
14
chart.listen("click", function () {
15
chart.shareWithTwitter();
16
});
17
18
// set the chart title
19
chart.title("Share the chart with Twitter");
20
21
// set the titles of the axes
22
chart.xAxis().title("Month");
23
chart.yAxis().title("Sales");
24
25
// set the container id
26
chart.container("container");
27
28
// initiate drawing the chart
29
chart.draw();
30
31
});