Your search did not match any results.
Pie Charts

Pie

Documentation

This demo illustrates the PieChart component that is often used when comparing the percentage values of different point arguments within a series.

www.wikipedia.org
Backend API
Copy to CodePen
Apply
Reset
const DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', ($scope) => { $scope.chartOptions = { size: { width: 500, }, palette: 'bright', dataSource, series: [ { argumentField: 'country', valueField: 'area', label: { visible: true, connector: { visible: true, width: 1, }, }, }, ], title: 'Area of Countries', export: { enabled: true, }, onPointClick(e) { const point = e.target; toggleVisibility(point); }, onLegendClick(e) { const arg = e.target; toggleVisibility(e.component.getAllSeries()[0].getPointsByArg(arg)[0]); }, }; function toggleVisibility(item) { if (item.isVisible()) { item.hide(); } else { item.show(); } } });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/21.2.3/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/21.2.3/css/dx.light.css" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C/script%3E'))</script> <script src="https://cdn3.devexpress.com/jslib/21.2.3/js/dx.all.js"></script> <script src="data.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container" ng-app="DemoApp" ng-controller="DemoController"> <div id="pie" dx-pie-chart="chartOptions"></div> </div> </body> </html>
#pie { height: 440px; } #pie * { margin: 0 auto; }
const dataSource = [{ country: 'Russia', area: 12, }, { country: 'Canada', area: 7, }, { country: 'USA', area: 7, }, { country: 'China', area: 7, }, { country: 'Brazil', area: 6, }, { country: 'Australia', area: 5, }, { country: 'India', area: 2, }, { country: 'Others', area: 55, }];