Dashboard sipadu mbip
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

custom-amchart.js 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. "use strict";
  2. $(document).ready(function() {
  3. var chartData = [{
  4. "date": "2012-01-01",
  5. "distance": 227,
  6. "townName": "New York",
  7. "townName2": "New York",
  8. "townSize": 25,
  9. "latitude": 40.71,
  10. "duration": 408
  11. }, {
  12. "date": "2012-01-02",
  13. "distance": 371,
  14. "townName": "Washington",
  15. "townSize": 14,
  16. "latitude": 38.89,
  17. "duration": 482
  18. }, {
  19. "date": "2012-01-03",
  20. "distance": 433,
  21. "townName": "Wilmington",
  22. "townSize": 6,
  23. "latitude": 34.22,
  24. "duration": 562
  25. }, {
  26. "date": "2012-01-04",
  27. "distance": 345,
  28. "townName": "Jacksonville",
  29. "townSize": 7,
  30. "latitude": 30.35,
  31. "duration": 379
  32. }, {
  33. "date": "2012-01-05",
  34. "distance": 480,
  35. "townName": "Miami",
  36. "townName2": "Miami",
  37. "townSize": 10,
  38. "latitude": 25.83,
  39. "duration": 501
  40. }, {
  41. "date": "2012-01-06",
  42. "distance": 386,
  43. "townName": "Tallahassee",
  44. "townSize": 7,
  45. "latitude": 30.46,
  46. "duration": 443
  47. }, {
  48. "date": "2012-01-07",
  49. "distance": 348,
  50. "townName": "New Orleans",
  51. "townSize": 10,
  52. "latitude": 29.94,
  53. "duration": 405
  54. }, {
  55. "date": "2012-01-08",
  56. "distance": 238,
  57. "townName": "Houston",
  58. "townName2": "Houston",
  59. "townSize": 16,
  60. "latitude": 29.76,
  61. "duration": 309
  62. }, {
  63. "date": "2012-01-09",
  64. "distance": 218,
  65. "townName": "Dalas",
  66. "townSize": 17,
  67. "latitude": 32.8,
  68. "duration": 287
  69. }, {
  70. "date": "2012-01-10"
  71. }, {
  72. "date": "2012-01-11"
  73. }, {
  74. "date": "2012-01-12"
  75. }, ];
  76. var chart = AmCharts.makeChart("chartdiv", {
  77. type: "serial",
  78. theme: "light",
  79. dataDateFormat: "YYYY-MM-DD",
  80. dataProvider: chartData,
  81. addClassNames: true,
  82. startDuration: 1,
  83. color: "black",
  84. marginLeft: 0,
  85. categoryField: "date",
  86. categoryAxis: {
  87. parseDates: true,
  88. minPeriod: "DD",
  89. autoGridCount: false,
  90. gridCount: 50,
  91. gridAlpha: 0.1,
  92. gridColor: "#52BEDB",
  93. axisColor: "#7D94A1",
  94. dateFormats: [{
  95. period: 'DD',
  96. format: 'DD'
  97. }, {
  98. period: 'WW',
  99. format: 'MMM DD'
  100. }, {
  101. period: 'MM',
  102. format: 'MMM'
  103. }, {
  104. period: 'YYYY',
  105. format: 'YYYY'
  106. }]
  107. },
  108. valueAxes: [{
  109. id: "a1",
  110. title: "distance",
  111. gridAlpha: 0,
  112. axisAlpha: 0
  113. }, {
  114. id: "a2",
  115. position: "right",
  116. gridAlpha: 0,
  117. axisAlpha: 0,
  118. labelsEnabled: false
  119. }, {
  120. id: "a3",
  121. title: "duration",
  122. position: "right",
  123. gridAlpha: 0,
  124. axisAlpha: 0,
  125. inside: true,
  126. duration: "mm",
  127. durationUnits: {
  128. DD: "d. ",
  129. hh: "h ",
  130. mm: "min",
  131. ss: ""
  132. }
  133. }],
  134. graphs: [{
  135. id: "g1",
  136. valueField: "distance",
  137. title: "distance",
  138. type: "column",
  139. fillAlphas: 0.9,
  140. valueAxis: "a1",
  141. balloonText: "[[value]] miles",
  142. legendValueText: "[[value]] mi",
  143. legendPeriodValueText: "total: [[value.sum]] mi",
  144. lineColor: "#52BEDB",
  145. alphaField: "alpha",
  146. }, {
  147. id: "g2",
  148. valueField: "latitude",
  149. classNameField: "bulletClass",
  150. title: "latitude/city",
  151. type: "line",
  152. valueAxis: "a2",
  153. lineColor: "black",
  154. lineThickness: 1,
  155. legendValueText: "[[description]]/[[value]]",
  156. descriptionField: "townName",
  157. bullet: "round",
  158. bulletSizeField: "townSize",
  159. bulletBorderColor: "#02617A",
  160. bulletBorderAlpha: 1,
  161. bulletBorderThickness: 2,
  162. bulletColor: "#89C4F4",
  163. labelText: "[[townName2]]",
  164. labelPosition: "right",
  165. balloonText: "latitude:[[value]]",
  166. showBalloon: true,
  167. animationPlayed: true,
  168. }, {
  169. id: "g3",
  170. title: "duration",
  171. valueField: "duration",
  172. type: "line",
  173. valueAxis: "a3",
  174. lineColor: "#E26A6A",
  175. balloonText: "[[value]]",
  176. lineThickness: 1,
  177. legendValueText: "[[value]]",
  178. bullet: "square",
  179. bulletBorderColor: "#E26A6A",
  180. bulletBorderThickness: 1,
  181. bulletBorderAlpha: 1,
  182. dashLengthField: "dashLength",
  183. animationPlayed: true
  184. }],
  185. chartCursor: {
  186. zoomable: false,
  187. categoryBalloonDateFormat: "DD",
  188. cursorAlpha: 0,
  189. valueBalloonsEnabled: false
  190. },
  191. legend: {
  192. bulletType: "round",
  193. equalWidths: false,
  194. valueWidth: 120,
  195. useGraphSettings: true,
  196. color: "black"
  197. }
  198. });
  199. });