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
// create data
4
var data = [
5
["January", 10000],
6
["February", 12000],
7
["March", 18000],
8
["April", 11000],
9
["May", 9000]
10
];
11
12
// create a chart
13
var chart = anychart.area();
14
15
// create an area series and set the data
16
var series = chart.area(data);
17
18
// set scale mode
19
chart.xScale().mode('continuous');
20
21
// set the chart title
22
chart.title("Area Chart: Scale Mode to Remove Gaps");
23
24
// set the titles of the axes
25
chart.xAxis().title("Month");
26
chart.yAxis().title("Sales, $");
27
28
// set the container id
29
chart.container("container");
30
31
// initiate drawing the chart
32
chart.draw();
33
});