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.

1055 lines
30 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. 'use strict';
  2. $(document).ready(function() {
  3. var ctx = document.getElementById('update-chart-1').getContext("2d");
  4. var myChart = new Chart(ctx, {
  5. type: 'bar',
  6. data: valincome('#fff', [25, 30, 20, 15, 20, 30, 20], '#fff'),
  7. options: valincomebuildoption(),
  8. });
  9. var ctx = document.getElementById('update-chart-2').getContext("2d");
  10. var myChart = new Chart(ctx, {
  11. type: 'bar',
  12. data: valincome('#fff', [10, 30, 20, 15, 30, 15, 30], '#fff'),
  13. options: valincomebuildoption(),
  14. });
  15. var ctx = document.getElementById('update-chart-3').getContext("2d");
  16. var myChart = new Chart(ctx, {
  17. type: 'bar',
  18. data: valincome('#fff', [25, 10, 20, 15, 20, 10, 20], '#fff'),
  19. options: valincomebuildoption(),
  20. });
  21. var ctx = document.getElementById('update-chart-4').getContext("2d");
  22. var myChart = new Chart(ctx, {
  23. type: 'bar',
  24. data: valincome('#fff', [25, 30, 20, 15, 10, 20, 15], '#fff'),
  25. options: valincomebuildoption(),
  26. });
  27. function valincome(a, b, f) {
  28. if (f == null) {
  29. f = "rgba(0,0,0,0)";
  30. }
  31. return {
  32. labels: ["1", "2", "3", "4", "5", "6", "7"],
  33. datasets: [{
  34. label: "",
  35. borderColor: a,
  36. borderWidth: 0,
  37. hitRadius: 30,
  38. pointRadius: 0,
  39. pointHoverRadius: 4,
  40. pointBorderWidth: 2,
  41. pointHoverBorderWidth: 12,
  42. pointBackgroundColor: Chart.helpers.color("#000000").alpha(0).rgbString(),
  43. pointBorderColor: a,
  44. pointHoverBackgroundColor: a,
  45. pointHoverBorderColor: Chart.helpers.color("#000000").alpha(.1).rgbString(),
  46. fill: true,
  47. backgroundColor: Chart.helpers.color(f).alpha(1).rgbString(),
  48. data: b,
  49. }]
  50. };
  51. }
  52. function valincomebuildoption() {
  53. return {
  54. maintainAspectRatio: false,
  55. title: {
  56. display: false,
  57. },
  58. tooltips: {
  59. display: false,
  60. },
  61. legend: {
  62. display: false
  63. },
  64. hover: {
  65. mode: 'index'
  66. },
  67. scales: {
  68. xAxes: [{
  69. display: false,
  70. gridLines: false,
  71. scaleLabel: {
  72. display: true,
  73. labelString: 'Month'
  74. }
  75. }],
  76. yAxes: [{
  77. display: false,
  78. gridLines: false,
  79. scaleLabel: {
  80. display: true,
  81. labelString: 'Value'
  82. },
  83. ticks: {
  84. min: 1,
  85. }
  86. }]
  87. },
  88. elements: {
  89. point: {
  90. radius: 4,
  91. borderWidth: 12
  92. }
  93. },
  94. layout: {
  95. padding: {
  96. left: 10,
  97. right: 0,
  98. top: 15,
  99. bottom: 0
  100. }
  101. }
  102. };
  103. }
  104. // project and visite start
  105. var chart = AmCharts.makeChart("visitor", {
  106. "type": "serial",
  107. "hideCredits": true,
  108. "theme": "light",
  109. "dataDateFormat": "YYYY-MM-DD",
  110. "precision": 2,
  111. "valueAxes": [{
  112. "id": "v1",
  113. "title": "Visitors",
  114. "position": "left",
  115. "autoGridCount": false,
  116. "labelFunction": function(value) {
  117. return "$" + Math.round(value) + "M";
  118. }
  119. }, {
  120. "id": "v2",
  121. "title": "New Visitors",
  122. "gridAlpha": 0,
  123. "position": "right",
  124. "autoGridCount": false
  125. }],
  126. "graphs": [{
  127. "id": "g3",
  128. "valueAxis": "v1",
  129. "lineColor": "#feb798",
  130. "fillColors": "#feb798",
  131. "fillAlphas": 1,
  132. "type": "column",
  133. "title": "old Visitor",
  134. "valueField": "sales2",
  135. "clustered": false,
  136. "columnWidth": 0.5,
  137. "legendValueText": "$[[value]]M",
  138. "balloonText": "[[title]]<br /><b style='font-size: 130%'>$[[value]]M</b>"
  139. }, {
  140. "id": "g4",
  141. "valueAxis": "v1",
  142. "lineColor": "#fe9365",
  143. "fillColors": "#fe9365",
  144. "fillAlphas": 1,
  145. "type": "column",
  146. "title": "New visitor",
  147. "valueField": "sales1",
  148. "clustered": false,
  149. "columnWidth": 0.3,
  150. "legendValueText": "$[[value]]M",
  151. "balloonText": "[[title]]<br /><b style='font-size: 130%'>$[[value]]M</b>"
  152. }, {
  153. "id": "g1",
  154. "valueAxis": "v2",
  155. "bullet": "round",
  156. "bulletBorderAlpha": 1,
  157. "bulletColor": "#FFFFFF",
  158. "bulletSize": 5,
  159. "hideBulletsCount": 50,
  160. "lineThickness": 2,
  161. "lineColor": "#0df3a3",
  162. "type": "smoothedLine",
  163. "title": "Last Month Visitor",
  164. "useLineColorForBulletBorder": true,
  165. "valueField": "market1",
  166. "balloonText": "[[title]]<br /><b style='font-size: 130%'>[[value]]</b>"
  167. }, {
  168. "id": "g2",
  169. "valueAxis": "v2",
  170. "bullet": "round",
  171. "bulletBorderAlpha": 1,
  172. "bulletColor": "#FFFFFF",
  173. "bulletSize": 5,
  174. "hideBulletsCount": 50,
  175. "lineThickness": 2,
  176. "lineColor": "#fe5d70",
  177. // "type": "smoothedLine",
  178. "dashLength": 5,
  179. "title": "Average Visitor",
  180. "useLineColorForBulletBorder": true,
  181. "valueField": "market2",
  182. "balloonText": "[[title]]<br /><b style='font-size: 130%'>[[value]]</b>"
  183. }],
  184. "chartCursor": {
  185. "pan": true,
  186. "valueLineEnabled": true,
  187. "valueLineBalloonEnabled": true,
  188. "cursorAlpha": 0,
  189. "valueLineAlpha": 0.2
  190. },
  191. "categoryField": "date",
  192. "categoryAxis": {
  193. "parseDates": true,
  194. "dashLength": 1,
  195. "minorGridEnabled": true
  196. },
  197. "legend": {
  198. "useGraphSettings": true,
  199. "position": "top"
  200. },
  201. "balloon": {
  202. "borderThickness": 1,
  203. "cornerRadius": 5,
  204. "shadowAlpha": 0
  205. },
  206. "dataProvider": [{
  207. "date": "2013-01-16",
  208. "market1": 71,
  209. "market2": 75,
  210. "sales1": 5,
  211. "sales2": 8
  212. }, {
  213. "date": "2013-01-17",
  214. "market1": 74,
  215. "market2": 78,
  216. "sales1": 4,
  217. "sales2": 6
  218. }, {
  219. "date": "2013-01-18",
  220. "market1": 78,
  221. "market2": 88,
  222. "sales1": 5,
  223. "sales2": 2
  224. }, {
  225. "date": "2013-01-19",
  226. "market1": 85,
  227. "market2": 89,
  228. "sales1": 8,
  229. "sales2": 9
  230. }, {
  231. "date": "2013-01-20",
  232. "market1": 82,
  233. "market2": 89,
  234. "sales1": 9,
  235. "sales2": 6
  236. }, {
  237. "date": "2013-01-21",
  238. "market1": 83,
  239. "market2": 85,
  240. "sales1": 3,
  241. "sales2": 5
  242. }, {
  243. "date": "2013-01-22",
  244. "market1": 88,
  245. "market2": 92,
  246. "sales1": 5,
  247. "sales2": 7
  248. }, {
  249. "date": "2013-01-23",
  250. "market1": 85,
  251. "market2": 90,
  252. "sales1": 7,
  253. "sales2": 6
  254. }, {
  255. "date": "2013-01-24",
  256. "market1": 85,
  257. "market2": 91,
  258. "sales1": 9,
  259. "sales2": 5
  260. }, {
  261. "date": "2013-01-25",
  262. "market1": 80,
  263. "market2": 84,
  264. "sales1": 5,
  265. "sales2": 8
  266. }, {
  267. "date": "2013-01-26",
  268. "market1": 87,
  269. "market2": 92,
  270. "sales1": 4,
  271. "sales2": 8
  272. }, {
  273. "date": "2013-01-27",
  274. "market1": 84,
  275. "market2": 87,
  276. "sales1": 3,
  277. "sales2": 4
  278. }, {
  279. "date": "2013-01-28",
  280. "market1": 83,
  281. "market2": 88,
  282. "sales1": 5,
  283. "sales2": 7
  284. }, {
  285. "date": "2013-01-29",
  286. "market1": 84,
  287. "market2": 87,
  288. "sales1": 5,
  289. "sales2": 8
  290. }, {
  291. "date": "2013-01-30",
  292. "market1": 81,
  293. "market2": 85,
  294. "sales1": 4,
  295. "sales2": 7
  296. }]
  297. });
  298. var chart = AmCharts.makeChart("proj-earning", {
  299. "type": "serial",
  300. "hideCredits": true,
  301. "theme": "light",
  302. "dataProvider": [{
  303. "type": "UI",
  304. "visits": 10
  305. }, {
  306. "type": "UX",
  307. "visits": 15
  308. }, {
  309. "type": "Web",
  310. "visits": 12
  311. }, {
  312. "type": "App",
  313. "visits": 16
  314. }, {
  315. "type": "SEO",
  316. "visits": 8
  317. }],
  318. "valueAxes": [{
  319. "gridAlpha": 0.3,
  320. "gridColor": "#fff",
  321. "axisColor": "transparent",
  322. "color": '#fff',
  323. "dashLength": 0
  324. }],
  325. "gridAboveGraphs": true,
  326. "startDuration": 1,
  327. "graphs": [{
  328. "balloonText": "Active User: <b>[[value]]</b>",
  329. "fillAlphas": 1,
  330. "lineAlpha": 1,
  331. "lineColor": "#fff",
  332. "type": "column",
  333. "valueField": "visits",
  334. "columnWidth": 0.5
  335. }],
  336. "chartCursor": {
  337. "categoryBalloonEnabled": false,
  338. "cursorAlpha": 0,
  339. "zoomable": false
  340. },
  341. "categoryField": "type",
  342. "categoryAxis": {
  343. "gridPosition": "start",
  344. "gridAlpha": 0,
  345. "axesAlpha": 0,
  346. "lineAlpha": 0,
  347. "fontSize": 12,
  348. "color": '#fff',
  349. "tickLength": 0
  350. },
  351. "export": {
  352. "enabled": false
  353. }
  354. });
  355. // sale order start
  356. var ctx = document.getElementById('sale-chart1').getContext("2d");
  357. var myChart = new Chart(ctx, {
  358. type: 'line',
  359. data: salechart('#b71c1c', [25, 30, 15, 20, 25, 30, 15, 25, 35, 30, 20, 10, 12, 1], 'transparent'),
  360. options: salebuildoption(),
  361. });
  362. var ctx = document.getElementById('sale-chart2').getContext("2d");
  363. var myChart = new Chart(ctx, {
  364. type: 'line',
  365. data: salechart('#00692c', [30, 15, 25, 35, 30, 20, 25, 30, 15, 20, 25, 10, 12, 1], 'transparent'),
  366. options: salebuildoption(),
  367. });
  368. var ctx = document.getElementById('sale-chart3').getContext("2d");
  369. var myChart = new Chart(ctx, {
  370. type: 'line',
  371. data: salechart('#096567', [15, 20, 25, 10, 30, 15, 25, 35, 30, 20, 25, 30, 12, 1], 'transparent'),
  372. options: salebuildoption(),
  373. });
  374. function salechart(a, b, f) {
  375. if (f == null) {
  376. f = "rgba(0,0,0,0)";
  377. }
  378. return {
  379. labels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"],
  380. datasets: [{
  381. label: "",
  382. borderColor: a,
  383. borderWidth: 2,
  384. hitRadius: 30,
  385. pointRadius: 3,
  386. pointHoverRadius: 4,
  387. pointBorderWidth: 5,
  388. pointHoverBorderWidth: 12,
  389. pointBackgroundColor: Chart.helpers.color("#000000").alpha(0).rgbString(),
  390. // pointBorderColor: Chart.helpers.color("#000000").alpha(0).rgbString(),
  391. pointBorderColor: a,
  392. pointHoverBackgroundColor: a,
  393. pointHoverBorderColor: Chart.helpers.color("#000000").alpha(.1).rgbString(),
  394. fill: true,
  395. lineTension: 0,
  396. backgroundColor: f,
  397. data: b,
  398. }]
  399. };
  400. }
  401. function salebuildoption() {
  402. return {
  403. maintainAspectRatio: false,
  404. title: {
  405. display: !1
  406. },
  407. tooltips: {
  408. position: 'nearest',
  409. mode: 'index',
  410. intersect: false,
  411. yPadding: 10,
  412. xPadding: 10,
  413. },
  414. legend: {
  415. display: !1,
  416. labels: {
  417. usePointStyle: !1
  418. }
  419. },
  420. responsive: !0,
  421. maintainAspectRatio: !0,
  422. hover: {
  423. mode: "index"
  424. },
  425. scales: {
  426. xAxes: [{
  427. display: !1,
  428. gridLines: !1,
  429. scaleLabel: {
  430. display: !0,
  431. labelString: "Month"
  432. }
  433. }],
  434. yAxes: [{
  435. display: !1,
  436. gridLines: !1,
  437. scaleLabel: {
  438. display: !0,
  439. labelString: "Value"
  440. },
  441. ticks: {
  442. beginAtZero: !0
  443. }
  444. }]
  445. },
  446. elements: {
  447. point: {
  448. radius: 4,
  449. borderWidth: 12
  450. }
  451. },
  452. layout: {
  453. padding: {
  454. left: 10,
  455. right: 10,
  456. top: 25,
  457. bottom: 25
  458. }
  459. }
  460. };
  461. }
  462. // sale order end
  463. var chartData = [{
  464. "date": "2012-01-01",
  465. "distance": 227,
  466. "townName": "New York",
  467. "townName2": "New York",
  468. "townSize": 25,
  469. "latitude": 40.71,
  470. "duration": 408
  471. }, {
  472. "date": "2012-01-02",
  473. "distance": 371,
  474. "townName": "Washington",
  475. "townSize": 14,
  476. "latitude": 38.89,
  477. "duration": 482
  478. }, {
  479. "date": "2012-01-03",
  480. "distance": 433,
  481. "townName": "Wilmington",
  482. "townSize": 6,
  483. "latitude": 34.22,
  484. "duration": 562
  485. }, {
  486. "date": "2012-01-04",
  487. "distance": 345,
  488. "townName": "Jacksonville",
  489. "townSize": 7,
  490. "latitude": 30.35,
  491. "duration": 379
  492. }, {
  493. "date": "2012-01-05",
  494. "distance": 480,
  495. "townName": "Miami",
  496. "townName2": "Miami",
  497. "townSize": 10,
  498. "latitude": 25.83,
  499. "duration": 501
  500. }, {
  501. "date": "2012-01-06",
  502. "distance": 386,
  503. "townName": "Tallahassee",
  504. "townSize": 7,
  505. "latitude": 30.46,
  506. "duration": 443
  507. }, {
  508. "date": "2012-01-07",
  509. "distance": 348,
  510. "townName": "New Orleans",
  511. "townSize": 10,
  512. "latitude": 29.94,
  513. "duration": 405
  514. }, {
  515. "date": "2012-01-08",
  516. "distance": 238,
  517. "townName": "Houston",
  518. "townName2": "Houston",
  519. "townSize": 16,
  520. "latitude": 29.76,
  521. "duration": 309
  522. }, {
  523. "date": "2012-01-09",
  524. "distance": 218,
  525. "townName": "Dalas",
  526. "townSize": 17,
  527. "latitude": 32.8,
  528. "duration": 287
  529. }, {
  530. "date": "2012-01-10",
  531. "distance": 349,
  532. "townName": "Oklahoma City",
  533. "townSize": 11,
  534. "latitude": 35.49,
  535. "duration": 485
  536. }, {
  537. "date": "2012-01-11",
  538. "distance": 603,
  539. "townName": "Kansas City",
  540. "townSize": 10,
  541. "latitude": 39.1,
  542. "duration": 890
  543. }, {
  544. "date": "2012-01-12",
  545. "distance": 534,
  546. "townName": "Denver",
  547. "townName2": "Denver",
  548. "townSize": 18,
  549. "latitude": 39.74,
  550. "duration": 810
  551. }, {
  552. "date": "2012-01-13",
  553. "townName": "Salt Lake City",
  554. "townSize": 12,
  555. "distance": 425,
  556. "duration": 670,
  557. "latitude": 40.75,
  558. "alpha": 0.4
  559. }, {
  560. "date": "2012-01-14",
  561. "latitude": 36.1,
  562. "duration": 470,
  563. "townName": "Las Vegas",
  564. "townName2": "Las Vegas",
  565. "bulletClass": "lastBullet"
  566. }, {
  567. "date": "2012-01-15"
  568. }];
  569. var chart = AmCharts.makeChart("monthly-graph", {
  570. "type": "serial",
  571. "theme": "light",
  572. "dataDateFormat": "YYYY-MM-DD",
  573. "dataProvider": chartData,
  574. "addClassNames": true,
  575. "startDuration": 1,
  576. "marginLeft": 0,
  577. "categoryField": "date",
  578. "categoryAxis": {
  579. "parseDates": true,
  580. "minPeriod": "DD",
  581. "autoGridCount": false,
  582. "gridCount": 50,
  583. "gridAlpha": 0.1,
  584. "gridColor": "#FFFFFF",
  585. "axisColor": "#555555",
  586. "dateFormats": [{
  587. "period": 'DD',
  588. "format": 'DD'
  589. }, {
  590. "period": 'WW',
  591. "format": 'MMM DD'
  592. }, {
  593. "period": 'MM',
  594. "format": 'MMM'
  595. }, {
  596. "period": 'YYYY',
  597. "format": 'YYYY'
  598. }]
  599. },
  600. "valueAxes": [{
  601. "id": "a1",
  602. "title": "Student",
  603. "gridAlpha": 0,
  604. "axisAlpha": 0
  605. }, {
  606. "id": "a2",
  607. "position": "right",
  608. "gridAlpha": 0,
  609. "axisAlpha": 0,
  610. "labelsEnabled": false
  611. }, {
  612. "id": "a3",
  613. "title": "",
  614. "position": "left",
  615. "gridAlpha": 0,
  616. "axisAlpha": 0,
  617. "lineAlpha": 0,
  618. "fontSize": 0,
  619. "inside": true,
  620. }],
  621. "graphs": [{
  622. "id": "g1",
  623. "valueField": "distance",
  624. "title": "distance",
  625. "type": "column",
  626. "fillAlphas": 0.9,
  627. // "cornerRadiusTop": 5,
  628. // "columnWidth": 0.3,
  629. "valueAxis": "a1",
  630. "balloonText": "[[value]] miles",
  631. "legendValueText": "[[value]] mi",
  632. "legendPeriodValueText": "total: [[value.sum]] mi",
  633. "lineColor": "#01a9ac",
  634. "alphaField": "alpha"
  635. }, {
  636. "id": "g2",
  637. "valueField": "latitude",
  638. "classNameField": "bulletClass",
  639. "title": "latitude/city",
  640. "type": "line",
  641. // "type": "smoothedLine",
  642. "valueAxis": "a2",
  643. "lineColor": "#303549",
  644. "lineThickness": 2,
  645. "dashLength": 8,
  646. "legendValueText": "[[value]]/[[description]]",
  647. "descriptionField": "townName",
  648. "bullet": "round",
  649. "bulletSizeField": "townSize",
  650. "bulletBorderColor": "#01a9ac",
  651. "bulletBorderAlpha": 1,
  652. "bulletBorderThickness": 2,
  653. "bulletColor": "#0ac282",
  654. "labelText": "[[townName2]]",
  655. "labelPosition": "right",
  656. "balloonText": "latitude:[[value]]",
  657. "showBalloon": true,
  658. "animationPlayed": true,
  659. }, {
  660. "id": "g3",
  661. "title": "duration",
  662. "valueField": "duration",
  663. "type": "line",
  664. "type": "smoothedLine",
  665. "valueAxis": "a3",
  666. "lineColor": "#fe5d70",
  667. "balloonText": "[[value]]",
  668. "lineThickness": 2,
  669. "legendValueText": "[[value]]",
  670. "bullet": "round",
  671. "bulletBorderColor": "#fe5d70",
  672. "bulletBorderThickness": 1,
  673. "bulletBorderAlpha": 1,
  674. "dashLengthField": "dashLength",
  675. "animationPlayed": true
  676. }]
  677. });
  678. var ctx = document.getElementById('tot-lead').getContext("2d");
  679. var myChart = new Chart(ctx, {
  680. type: 'line',
  681. data: valincomearrow('#01a9ac', [30, 15, 25, 35, 30, 20, 15, 20, 25, 40, 25, 30, 22, 31], '#01a9ac'),
  682. options: valincomearowbuildoption(),
  683. });
  684. var ctx = document.getElementById('tot-vendor').getContext("2d");
  685. var myChart = new Chart(ctx, {
  686. type: 'line',
  687. data: valincomearrow('#fe9365', [40, 25, 30, 22, 30, 15, 25, 35, 30, 20, 15, 20, 25, 31], '#fe9365'),
  688. options: valincomearowbuildoption(),
  689. });
  690. var ctx = document.getElementById('invoice-gen').getContext("2d");
  691. var myChart = new Chart(ctx, {
  692. type: 'line',
  693. data: valincomearrow('#0ac282', [25, 30, 20, 15, 20, 25, 31, 22, 30, 15, 25, 35, 30, 40], '#0ac282'),
  694. options: valincomearowbuildoption(),
  695. });
  696. function valincomearrow(a, b, f) {
  697. if (f == null) {
  698. f = "rgba(0,0,0,0)";
  699. }
  700. return {
  701. labels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"],
  702. datasets: [{
  703. label: "",
  704. borderColor: a,
  705. borderWidth: 3,
  706. hitRadius: 30,
  707. pointRadius: 0,
  708. pointHoverRadius: 4,
  709. pointBorderWidth: 2,
  710. pointHoverBorderWidth: 12,
  711. pointBackgroundColor: Chart.helpers.color("#000000").alpha(0).rgbString(),
  712. pointBorderColor: a,
  713. pointHoverBackgroundColor: a,
  714. pointHoverBorderColor: Chart.helpers.color("#000000").alpha(.1).rgbString(),
  715. fill: true,
  716. lineTension: 0,
  717. backgroundColor: Chart.helpers.color(f).alpha(.7).rgbString(),
  718. data: b,
  719. }]
  720. };
  721. }
  722. function valincomearowbuildoption() {
  723. return {
  724. maintainAspectRatio: true,
  725. title: {
  726. display: false,
  727. },
  728. tooltips: {
  729. intersect: false,
  730. mode: 'nearest',
  731. xPadding: 10,
  732. yPadding: 10,
  733. caretPadding: 10
  734. },
  735. legend: {
  736. display: false
  737. },
  738. hover: {
  739. mode: 'index'
  740. },
  741. scales: {
  742. xAxes: [{
  743. display: false,
  744. gridLines: false,
  745. scaleLabel: {
  746. display: true,
  747. labelString: 'Month'
  748. }
  749. }],
  750. yAxes: [{
  751. display: false,
  752. gridLines: false,
  753. scaleLabel: {
  754. display: true,
  755. labelString: 'Value'
  756. },
  757. ticks: {
  758. min: 1,
  759. max: 50
  760. }
  761. }]
  762. },
  763. elements: {
  764. point: {
  765. radius: 4,
  766. borderWidth: 12
  767. }
  768. },
  769. layout: {
  770. padding: {
  771. left: 0,
  772. right: 0,
  773. top: 0,
  774. bottom: 0
  775. }
  776. }
  777. };
  778. }
  779. $(function() {
  780. var amchart = AmCharts.makeChart("sales-analytics", {
  781. "type": "serial",
  782. "theme": "light",
  783. "marginTop": 0,
  784. "marginRight": 0,
  785. "dataProvider": [{
  786. "year": "1950",
  787. "value": -0.307
  788. }, {
  789. "year": "1951",
  790. "value": -0.168
  791. }, {
  792. "year": "1952",
  793. "value": -0.073
  794. }, {
  795. "year": "1953",
  796. "value": -0.027
  797. }, {
  798. "year": "1954",
  799. "value": -0.251
  800. }, {
  801. "year": "1955",
  802. "value": -0.281
  803. }, {
  804. "year": "1956",
  805. "value": -0.348
  806. }, {
  807. "year": "1957",
  808. "value": -0.074
  809. }, {
  810. "year": "1958",
  811. "value": -0.011
  812. }, {
  813. "year": "1959",
  814. "value": -0.074
  815. }, {
  816. "year": "1960",
  817. "value": -0.124
  818. }, {
  819. "year": "1961",
  820. "value": -0.024
  821. }, {
  822. "year": "1962",
  823. "value": -0.022
  824. }, {
  825. "year": "1963",
  826. "value": 0
  827. }, {
  828. "year": "1964",
  829. "value": -0.296
  830. }, {
  831. "year": "1965",
  832. "value": -0.217
  833. }, {
  834. "year": "1966",
  835. "value": -0.147
  836. }, {
  837. "year": "1967",
  838. "value": -0.15
  839. }, {
  840. "year": "1968",
  841. "value": -0.16
  842. }, {
  843. "year": "1969",
  844. "value": -0.011
  845. }, {
  846. "year": "1970",
  847. "value": -0.068
  848. }, {
  849. "year": "1971",
  850. "value": -0.19
  851. }, {
  852. "year": "1972",
  853. "value": -0.056
  854. }, {
  855. "year": "1973",
  856. "value": 0.077
  857. }, {
  858. "year": "1974",
  859. "value": -0.213
  860. }, {
  861. "year": "1975",
  862. "value": -0.17
  863. }, {
  864. "year": "1976",
  865. "value": -0.254
  866. }, {
  867. "year": "1977",
  868. "value": 0.019
  869. }, {
  870. "year": "1978",
  871. "value": -0.063
  872. }, {
  873. "year": "1979",
  874. "value": 0.05
  875. }, {
  876. "year": "1980",
  877. "value": 0.077
  878. }, {
  879. "year": "1981",
  880. "value": 0.12
  881. }, {
  882. "year": "1982",
  883. "value": 0.011
  884. }, {
  885. "year": "1983",
  886. "value": 0.177
  887. }, {
  888. "year": "1984",
  889. "value": -0.021
  890. }, {
  891. "year": "1985",
  892. "value": -0.037
  893. }, {
  894. "year": "1986",
  895. "value": 0.03
  896. }, {
  897. "year": "1987",
  898. "value": 0.179
  899. }, {
  900. "year": "1988",
  901. "value": 0.18
  902. }, {
  903. "year": "1989",
  904. "value": 0.104
  905. }, {
  906. "year": "1990",
  907. "value": 0.255
  908. }, {
  909. "year": "1991",
  910. "value": 0.21
  911. }, {
  912. "year": "1992",
  913. "value": 0.065
  914. }, {
  915. "year": "1993",
  916. "value": 0.11
  917. }, {
  918. "year": "1994",
  919. "value": 0.172
  920. }, {
  921. "year": "1995",
  922. "value": 0.269
  923. }, {
  924. "year": "1996",
  925. "value": 0.141
  926. }, {
  927. "year": "1997",
  928. "value": 0.353
  929. }, {
  930. "year": "1998",
  931. "value": 0.548
  932. }, {
  933. "year": "1999",
  934. "value": 0.298
  935. }, {
  936. "year": "2000",
  937. "value": 0.267
  938. }, {
  939. "year": "2001",
  940. "value": 0.411
  941. }, {
  942. "year": "2002",
  943. "value": 0.462
  944. }, {
  945. "year": "2003",
  946. "value": 0.47
  947. }, {
  948. "year": "2004",
  949. "value": 0.445
  950. }, {
  951. "year": "2005",
  952. "value": 0.47
  953. }],
  954. "valueAxes": [{
  955. "axisAlpha": 0,
  956. "gridAlpha": 0,
  957. "position": "left"
  958. }],
  959. "graphs": [{
  960. "id": "g1",
  961. "balloonText": "[[category]]<br><b><span style='font-size:14px;'>[[value]]</span></b>",
  962. "bullet": "round",
  963. "bulletSize": 8,
  964. "lineColor": "#fe5d70",
  965. "lineThickness": 2,
  966. "negativeLineColor": "#fe9365",
  967. "type": "smoothedLine",
  968. "valueField": "value"
  969. }],
  970. "chartScrollbar": {
  971. "graph": "g1",
  972. "gridAlpha": 0,
  973. "color": "#888888",
  974. "scrollbarHeight": 55,
  975. "backgroundAlpha": 0,
  976. "selectedBackgroundAlpha": 0.1,
  977. "selectedBackgroundColor": "#888888",
  978. "graphFillAlpha": 0,
  979. "autoGridCount": true,
  980. "selectedGraphFillAlpha": 0,
  981. "graphLineAlpha": 0.2,
  982. "graphLineColor": "#c2c2c2",
  983. "selectedGraphLineColor": "#888888",
  984. "selectedGraphLineAlpha": 1
  985. },
  986. "chartCursor": {
  987. "categoryBalloonDateFormat": "YYYY",
  988. "cursorAlpha": 0,
  989. "valueLineEnabled": true,
  990. "valueLineBalloonEnabled": true,
  991. "valueLineAlpha": 0.5,
  992. "fullWidth": true
  993. },
  994. "dataDateFormat": "YYYY",
  995. "categoryField": "year",
  996. "categoryAxis": {
  997. "minPeriod": "YYYY",
  998. "parseDates": true,
  999. "gridAlpha": 0,
  1000. "minorGridAlpha": 0,
  1001. "minorGridEnabled": true
  1002. },
  1003. "export": {
  1004. "enabled": true
  1005. }
  1006. });
  1007. amchart.addListener("rendered", zoomChart);
  1008. if (amchart.zoomChart) {
  1009. amchart.zoomChart();
  1010. }
  1011. function zoomChart() {
  1012. amchart.zoomToIndexes(Math.round(amchart.dataProvider.length * 0.4), Math.round(amchart.dataProvider.length * 0.55));
  1013. }
  1014. });
  1015. var ctx = document.getElementById("newuserchart").getContext("2d");
  1016. window.myDoughnut = new Chart(ctx, {
  1017. type: 'doughnut',
  1018. data: {
  1019. datasets: [{
  1020. data: [10, 34, 5],
  1021. backgroundColor: ["#fe9365", "#01a9ac", "#fe5d70"],
  1022. label: 'Dataset 1'
  1023. }],
  1024. labels: ["Satisfied", "Unsatisfied", "NA"]
  1025. },
  1026. options: {
  1027. maintainAspectRatio: false,
  1028. responsive: true,
  1029. legend: {
  1030. position: 'bottom',
  1031. },
  1032. title: {
  1033. display: true,
  1034. text: "",
  1035. },
  1036. animation: {
  1037. animateScale: true,
  1038. animateRotate: true
  1039. }
  1040. }
  1041. });
  1042. });