Your search did not match any results.
Pie Charts

Pie

Documentation

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

www.nationmaster.com
Copy to CodePen
Apply
Reset
var DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', function DemoController($scope) { $scope.chartOptions = { size: { width: 500 }, palette: "bright", dataSource: dataSource, series: [ { argumentField: "country", valueField: "area", label: { visible: true, connector: { visible: true, width: 1 } } } ], title: "Area of Countries", "export": { enabled: true }, onPointClick: function (e) { var point = e.target; toggleVisibility(point); }, onLegendClick: function (e) { var 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.1.0/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery-3.1.0.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.4/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.4/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.2.4/css/dx.light.css" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/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/17.2.4/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; }
var 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 }];