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 dataSet = anychart.data.set([
3
{name: 'Point 1', value: 10},
4
{name: 'Point 2', value: 7},
5
{name: 'Point 3', value: 20},
6
{name: 'Point 4', value: 50},
7
{name: 'Point 5', value: 36},
8
{name: 'Point 6', value: 28},
9
{name: 'Point 7', value: 23}
10
]);
11
12
var chart = anychart.pie();
13
14
var view = dataSet.mapAs();
15
16
var filteredView = view.filter('value', function (value) {
17
return value >= 20;
18
});
19
20
// Set data.
21
chart.data(filteredView);
22
23
chart.title('Set chart data using view');
24
chart.container('container');
25
chart.draw();
26
});