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
var chart = anychart.area([
3
{x: 0, value: 864},
4
{x: 10, value: 754},
5
{x: 20, value: 742},
6
{x: 30, value: 837},
7
{x: 40, value: 801},
8
{x: 50, value: 706},
9
{x: 60, value: 753},
10
{x: 70, value: 816},
11
{x: 80, value: 734},
12
{x: 90, value: 745},
13
{x: 100, value: 853}
14
]);
15
16
chart.yScale({minimum: 500});
17
chart.xScale({type: 'linear', ticks: {interval: 10}, maximum: 100});
18
19
var controller = chart.annotations();
20
21
var annotation = controller.label();
22
annotation.valueAnchor(706);
23
annotation.xAnchor(50);
24
annotation.text('Minimum elevation');
25
annotation.anchor('center-top');
26
27
// Set background settings.
28
annotation.background('#EEEEEE');
29
30
chart.title('Set background parameter as a string');
31
chart.container('container');
32
chart.draw();
33
});