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
// chart type
4
var chart = anychart.area();
5
6
// set title
7
chart.title("Column Chart");
8
9
chart.splineArea([
10
{x: "P1", value: 16},
11
{x: "P2", value: 12},
12
{x: "P3", value: 9},
13
{x: "P5", value: 10},
14
{x: "P6", value: 12.5},
15
{x: "P7", value: 14},
16
{x: "P8", value: 17},
17
{x: "P9", value: 18},
18
{x: "P10", value: 15},
19
{x: "P11", value: 11},
20
{x: "P12", value: 8},
21
{x: "P13", value: 5},
22
{x: "P14", value: 6},
23
{x: "P15", value: 11},
24
{x: "P16", value: 13},
25
{x: "P17", value: 18},
26
{x: "P18", value: 21},
27
{x: "P19", value: 25},
28
{x: "P20", value: 28}
29
]);
30
31
// adjust title background fill
32
var title = chart.title();
33
title.enabled(true);
34
title.text("Radial Gradient Background Fill");
35
title.background("#FFF");
36
37
// adjust chart background fill
38
var background = chart.background();
39
background.fill(['#fff', '#66f', '#fff'], 0.5, 0.5, -130);
40
41
// draw
42
chart.container("container");
43
chart.draw();
44
});