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
3
var container = $('#container');
4
5
// create a data set
6
var data = anychart.data.set([
7
["January", 10000],
8
["February", 12000],
9
["March", 18000],
10
["April", 11000],
11
["May", 9000]
12
]);
13
14
// set the chart type
15
var chart = anychart.area();
16
17
chart.listen("click", function() {
18
chart.shareWithLinkedIn("Sharing with LinkedIn", "This is a sample of an Area Chart created with AnyChart");
19
});
20
21
// create a series and set the data
22
chart.area(data);
23
24
// set the chart title
25
chart.title("Share the chart with LinkedIn with parameters");
26
27
// set the titles of the axes
28
var xAxis = chart.xAxis();
29
xAxis.title("Month");
30
var yAxis = chart.yAxis();
31
yAxis.title("Sales");
32
33
// set the container id
34
chart.container("container");
35
36
// initiate drawing the chart
37
chart.draw();
38
39
});