pie4.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <!-- AmCharts includes -->
  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. <!-- Export plugin includes and styles -->
  10. <script src="../export.js"></script>
  11. <link type="text/css" href="../export.css" rel="stylesheet">
  12. <style>
  13. body, html {
  14. height: 100%;
  15. padding: 0;
  16. margin: 0;
  17. overflow: hidden;
  18. font-size: 11px;
  19. font-family: Verdana;
  20. }
  21. #chartdiv, #chartdiv2 {
  22. width: 50%;
  23. height: 100%;
  24. float: left;
  25. position: relative;
  26. }
  27. </style>
  28. <script type="text/javascript">
  29. var chart = AmCharts.makeChart( "chartdiv", {
  30. "type": "pie",
  31. "dataProvider": [ {
  32. "country": "Czech Republic",
  33. "litres": 156.9
  34. }, {
  35. "country": "Ireland",
  36. "litres": 131.1
  37. }, {
  38. "country": "Germany",
  39. "litres": 115.8
  40. }, {
  41. "country": "Australia",
  42. "litres": 109.9
  43. }, {
  44. "country": "Austria",
  45. "litres": 108.3
  46. }, {
  47. "country": "UK",
  48. "litres": 65
  49. }, {
  50. "country": "Belgium",
  51. "litres": 50
  52. } ],
  53. "titleField": "country",
  54. "valueField": "litres",
  55. "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
  56. "innerRadius": "30%",
  57. "labelsEnabled": false,
  58. "export": {
  59. "enabled": true,
  60. "libs": {
  61. "path": "../libs/"
  62. }
  63. }
  64. } );
  65. var chart2 = AmCharts.makeChart( "chartdiv2", {
  66. "type": "pie",
  67. "pathToImages": "http://www.amcharts.com/lib/3/images/",
  68. "dataProvider": [ {
  69. "country": "Czech Republic",
  70. "litres": 20
  71. }, {
  72. "country": "Ireland",
  73. "litres": 30
  74. }, {
  75. "country": "Germany",
  76. "litres": 15
  77. }, {
  78. "country": "Australia",
  79. "litres": 10
  80. } ],
  81. "titleField": "country",
  82. "valueField": "litres",
  83. "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
  84. "innerRadius": "30%",
  85. "labelsEnabled": false,
  86. "export": {
  87. "enabled": true
  88. }
  89. } );
  90. </script>
  91. </head>
  92. <body>
  93. <div id="chartdiv"></div>
  94. <div id="chartdiv2"></div>
  95. </body>
  96. </html>