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
window.onload = function() { var viewModel = { 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(this.getAllSeries()[0].getPointsByArg(arg)[0]); } } }; function toggleVisibility(item) { if(item.isVisible()) { item.hide(); } else { item.show(); } } ko.applyBindings(viewModel, document.getElementById("chart-demo")); };
<!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="js/jquery-3.1.0.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.5/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.5/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.1.5/css/dx.light.css" /> <script src="https://cdn3.devexpress.com/jslib/17.1.5/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"> <div id="chart-demo"> <div id="pie" data-bind="dxPieChart: chartOptions"></div> </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 }];