pie_json.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  6. <title>amCharts Data Loader Example</title>
  7. <script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
  8. <script src="http://www.amcharts.com/lib/3/pie.js"></script>
  9. <script src="../dataloader.min.js"></script>
  10. <style>
  11. body, html {
  12. font-family: Verdana;
  13. font-size: 12px;
  14. }
  15. #chartdiv {
  16. width: 100%;
  17. height: 500px;
  18. }
  19. </style>
  20. <script>
  21. AmCharts.makeChart("chartdiv", {
  22. "type": "pie",
  23. "dataLoader": {
  24. "url": "data/pie.json",
  25. "showCurtain": false
  26. },
  27. "titleField": "country",
  28. "valueField": "litres",
  29. "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
  30. "innerRadius": "30%",
  31. "legend": {
  32. "align": "center",
  33. "markerType": "circle"
  34. },
  35. "responsive": {
  36. "enabled": true,
  37. "addDefaultRules": true,
  38. "rules": [
  39. {
  40. "minWidth": 500,
  41. "overrides": {
  42. "innerRadius": "50%",
  43. }
  44. }
  45. ]
  46. }
  47. });
  48. </script>
  49. </head>
  50. <body>
  51. <div id="chartdiv"></div>
  52. </body>
  53. </html>