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.

57 lines
1.7 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. country: "Czech Republic",
  14. litres: 301.90
  15. }, {
  16. country: "Ireland",
  17. litres: 201.10
  18. }, {
  19. country: "Germany",
  20. litres: 165.80
  21. }, {
  22. country: "Australia",
  23. litres: 139.90
  24. }, {
  25. country: "Austria",
  26. litres: 128.30
  27. }, {
  28. country: "UK",
  29. litres: 99.00
  30. }, {
  31. country: "Belgium",
  32. litres: 60.00
  33. }];
  34. AmCharts.ready(function () {
  35. // PIE CHART
  36. chart = new AmCharts.AmPieChart();
  37. chart.dataProvider = chartData;
  38. chart.titleField = "country";
  39. chart.valueField = "litres";
  40. chart.outlineColor = "#FFFFFF";
  41. chart.outlineAlpha = 0.8;
  42. chart.outlineThickness = 2;
  43. // WRITE
  44. chart.write("chartdiv");
  45. });
  46. </script>
  47. </head>
  48. <body>
  49. <div id="chartdiv" style="width: 100%; height: 400px;"></div>
  50. </body>
  51. </html>