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.sparkline();
3
4
// Set data.
5
chart.data([
6
{name: 'Point 1', value: 1},
7
{name: 'Point 2', value: 35},
8
{name: 'Point 3', value: 5},
9
{name: 'Point 4', value: 43},
10
{name: 'Point 5', value: 15}
11
]);
12
13
chart.title({text: 'Set chart data as an array of objects', orientation: 'top'});
14
chart.container('container');
15
chart.draw();
16
});