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.pie([
3
{x: 'Cycling', value: 7},
4
{x: 'Swimming', value: 7},
5
{x: 'Run', value: 7},
6
{x: 'Hiking', value: 7},
7
{x: 'Alpinism', value: 7}
8
]);
9
chart.labels(null).legend(null);
10
11
// Create palette.
12
var palette = anychart.palettes.rangeColors();
13
palette.items(['#90caf9', '#42a5f5']);
14
palette.count(chart.data().length);
15
16
// Set palette.
17
chart.palette(palette);
18
19
chart.title('Set palette parameters as an instance');
20
chart.container('container');
21
chart.draw();
22
});