| 1 | <!DOCTYPE HTML> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 5 | <title>Pie 2D</title> |
| 6 | <style type="text/css"> |
| 7 | @import "../../../dojo/resources/dojo.css"; |
| 8 | @import "../../../dijit/tests/css/dijitTests.css"; |
| 9 | </style> |
| 10 | <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true, async: true"></script> |
| 11 | <script type="text/javascript"> |
| 12 | require([ |
| 13 | "dojox/charting/Chart", |
| 14 | "dojox/charting/plot2d/Pie", |
| 15 | "dojox/charting/themes/PlotKit/blue", |
| 16 | "dojox/charting/widget/Legend", |
| 17 | "dojo/domReady!" |
| 18 | ], function (Chart, Pie, pkBlue, Legend) { |
| 19 | var chart1 = new Chart("test1"); |
| 20 | chart1.setTheme(pkBlue); |
| 21 | chart1.addPlot("default", { |
| 22 | type: Pie, |
| 23 | font: "normal normal bold 12pt Tahoma", |
| 24 | fontColor: "blue", |
| 25 | labelOffset: 5, |
| 26 | labelStyle: "columns", |
| 27 | labelWiring: "ccc", |
| 28 | minWidth: 10 // 10 pixes min |
| 29 | }); |
| 30 | chart1.addSeries("Series A", [{ |
| 31 | y: 0.004, |
| 32 | text: 0.004 |
| 33 | }, { |
| 34 | y: 0.002, |
| 35 | text: 0.002 |
| 36 | }, { |
| 37 | y: 400000, |
| 38 | text: "400,000" |
| 39 | }, { |
| 40 | y: 0.004, |
| 41 | text: 0.004 |
| 42 | }]); |
| 43 | chart1.render(); |
| 44 | var legend = Legend({ |
| 45 | chart: chart1, |
| 46 | horizontal: false |
| 47 | }, "legend"); |
| 48 | }); |
| 49 | </script> |
| 50 | </head> |
| 51 | <body> |
| 52 | <h1>Pie</h1> |
| 53 | <p>Pie with 2 slices with one MUCH larger than all the others, but minwidth keeps it from not showing the small ones.</p> |
| 54 | <div id="test1" style="width: 300px; height: 300px;"></div> |
| 55 | <div id="legend"></div> |
| 56 | <p>That's all Folks!</p> |
| 57 | </body> |
| 58 | </html> |
| 59 |