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.

73 lines
2.3 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/radar.js" type="text/javascript"></script>
  9. <script>
  10. var chart;
  11. var chartData = [
  12. {
  13. "country": "Czech Republic",
  14. "litres": 156.9
  15. },
  16. {
  17. "country": "Ireland",
  18. "litres": 131.1
  19. },
  20. {
  21. "country": "Germany",
  22. "litres": 115.8
  23. },
  24. {
  25. "country": "Australia",
  26. "litres": 109.9
  27. },
  28. {
  29. "country": "Austria",
  30. "litres": 108.3
  31. },
  32. {
  33. "country": "UK",
  34. "litres": 99
  35. }
  36. ];
  37. AmCharts.ready(function () {
  38. // RADAR CHART
  39. chart = new AmCharts.AmRadarChart();
  40. chart.dataProvider = chartData;
  41. chart.categoryField = "country";
  42. chart.startDuration = 2;
  43. // VALUE AXIS
  44. var valueAxis = new AmCharts.ValueAxis();
  45. valueAxis.axisAlpha = 0.15;
  46. valueAxis.minimum = 0;
  47. valueAxis.dashLength = 3;
  48. valueAxis.axisTitleOffset = 20;
  49. valueAxis.gridCount = 5;
  50. chart.addValueAxis(valueAxis);
  51. // GRAPH
  52. var graph = new AmCharts.AmGraph();
  53. graph.valueField = "litres";
  54. graph.bullet = "round";
  55. graph.balloonText = "[[value]] litres of beer per year";
  56. chart.addGraph(graph);
  57. // WRITE
  58. chart.write("chartdiv");
  59. });
  60. </script>
  61. </head>
  62. <body>
  63. <div id="chartdiv" style="width:600px; height:400px;"></div>
  64. </body>
  65. </html>