You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.0 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. <title>amCharts examples</title>
  6. <link rel="stylesheet" href="style.css" type="text/css">
  7. <script src="../amcharts/amcharts.js" type="text/javascript"></script>
  8. <script src="../amcharts/pie.js" type="text/javascript"></script>
  9. <script>
  10. var chart;
  11. var legend;
  12. var chartData = [
  13. {
  14. "country": "Lithuania",
  15. "value": 260
  16. },
  17. {
  18. "country": "Ireland",
  19. "value": 201
  20. },
  21. {
  22. "country": "Germany",
  23. "value": 65
  24. },
  25. {
  26. "country": "Australia",
  27. "value": 39
  28. },
  29. {
  30. "country": "UK",
  31. "value": 19
  32. },
  33. {
  34. "country": "Latvia",
  35. "value": 10
  36. }
  37. ];
  38. AmCharts.ready(function () {
  39. // PIE CHART
  40. chart = new AmCharts.AmPieChart();
  41. chart.dataProvider = chartData;
  42. chart.titleField = "country";
  43. chart.valueField = "value";
  44. chart.outlineColor = "#FFFFFF";
  45. chart.outlineAlpha = 0.8;
  46. chart.outlineThickness = 2;
  47. chart.balloonText = "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>";
  48. // this makes the chart 3D
  49. chart.depth3D = 15;
  50. chart.angle = 30;
  51. // WRITE
  52. chart.write("chartdiv");
  53. });
  54. </script>
  55. </head>
  56. <body>
  57. <div id="chartdiv" style="width: 100%; height: 400px;"></div>
  58. </body>
  59. </html>