charts.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982
  1. (function($) {
  2. "use strict";
  3. /*chart-employment*/
  4. var chart = c3.generate({
  5. bindto: '#chart-employment', // id of chart wrapper
  6. data: {
  7. columns: [
  8. // each columns data
  9. ['data1', 9, 4, 9, 11, 15, 17],
  10. ['data2', 7, 17, 13, 17, 25, 28],
  11. ['data3', 18, 19, 22, 21, 32, 28]
  12. ],
  13. type: 'line', // default type of chart
  14. colors: {
  15. data1: '#6c5ffc',
  16. data2: '#05c3fb',
  17. data3: '#09ad95'
  18. },
  19. names: {
  20. // name of each serie
  21. 'data1': 'May',
  22. 'data2': 'June',
  23. 'data3': 'July'
  24. }
  25. },
  26. axis: {
  27. x: {
  28. type: 'category',
  29. // name of each category
  30. categories: ['2013', '2014', '2015', '2016', '2017', '2018']
  31. },
  32. },
  33. legend: {
  34. show: false, //hide legend
  35. },
  36. padding: {
  37. bottom: 0,
  38. top: 0
  39. },
  40. });
  41. /*chart-temperature*/
  42. var chart = c3.generate({
  43. bindto: '#chart-temperature', // id of chart wrapper
  44. data: {
  45. columns: [
  46. // each columns data
  47. ['data1', 8.0, 7.9, 10.5, 15.5, 19.4, 22.5, 26.2, 27.5, 24.3, 19.3, 14.9, 10.6],
  48. ['data2', 4.9, 5.2, 6.7, 9.5, 12.9, 16.2, 18.0, 17.6, 15.2, 11.3, 7.6, 5.8]
  49. ],
  50. labels: true,
  51. type: 'line', // default type of chart
  52. colors: {
  53. data1: '#6c5ffc',
  54. data2: '#05c3fb'
  55. },
  56. names: {
  57. // name of each serie
  58. 'data1': 'India',
  59. 'data2': 'USA'
  60. }
  61. },
  62. axis: {
  63. x: {
  64. type: 'category',
  65. // name of each category
  66. categories: ['May', 'June', 'July', 'Aug', 'Sep', 'Oct']
  67. },
  68. },
  69. legend: {
  70. show: false, //hide legend
  71. },
  72. padding: {
  73. bottom: 0,
  74. top: 0
  75. },
  76. });
  77. /*chart-area*/
  78. var chart = c3.generate({
  79. bindto: '#chart-area', // id of chart wrapper
  80. data: {
  81. columns: [
  82. // each columns data
  83. ['data1', 12, 8, 16, 19, 20, 18],
  84. ['data2', 12, 5, 6, 8, 10, 13]
  85. ],
  86. type: 'area', // default type of chart
  87. colors: {
  88. data1: '#6c5ffc',
  89. data2: '#05c3fb'
  90. },
  91. names: {
  92. // name of each serie
  93. 'data1': 'Maximum',
  94. 'data2': 'Minimum'
  95. }
  96. },
  97. axis: {
  98. x: {
  99. type: 'category',
  100. // name of each category
  101. categories: ['May', 'June', 'July', 'Aug', 'Sep', 'Oct']
  102. },
  103. },
  104. legend: {
  105. show: false, //hide legend
  106. },
  107. padding: {
  108. bottom: 0,
  109. top: 0
  110. },
  111. });
  112. /*chart-area-spline*/
  113. var chart = c3.generate({
  114. bindto: '#chart-area-spline', // id of chart wrapper
  115. data: {
  116. columns: [
  117. // each columns data
  118. ['data1', 10, 8, 10, 12, 20, 18],
  119. ['data2', 8, 12, 8, 20, 10, 13]
  120. ],
  121. type: 'area-spline', // default type of chart
  122. colors: {
  123. data1: '#6c5ffc',
  124. data2: '#05c3fb'
  125. },
  126. names: {
  127. // name of each serie
  128. 'data1': 'data1',
  129. 'data2': 'data2'
  130. }
  131. },
  132. axis: {
  133. x: {
  134. type: 'category',
  135. // name of each category
  136. categories: ['May', 'June', 'July', 'Aug', 'Sep', 'Oct']
  137. },
  138. },
  139. legend: {
  140. show: false, //hide legend
  141. },
  142. padding: {
  143. bottom: 0,
  144. top: 0
  145. },
  146. });
  147. /*chart-area-spline-sracked*/
  148. var chart = c3.generate({
  149. bindto: '#chart-area-spline-sracked', // id of chart wrapper
  150. data: {
  151. columns: [
  152. // each columns data
  153. ['data1', 12, 9, 16, 19, 20, 18],
  154. ['data2', 8, 8, 6, 8, 10, 13]
  155. ],
  156. type: 'area-spline', // default type of chart
  157. groups: [
  158. ['data1', 'data2']
  159. ],
  160. colors: {
  161. data1: '#6c5ffc',
  162. data2: '#05c3fb'
  163. },
  164. names: {
  165. // name of each serie
  166. 'data1': 'Maximum',
  167. 'data2': 'Minimum'
  168. }
  169. },
  170. axis: {
  171. x: {
  172. type: 'category',
  173. // name of each category
  174. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
  175. },
  176. },
  177. legend: {
  178. show: false, //hide legend
  179. },
  180. padding: {
  181. bottom: 0,
  182. top: 0
  183. },
  184. });
  185. /*chart-area-spline-sracked*/
  186. var chart = c3.generate({
  187. bindto: '#chart-sracked', // id of chart wrapper
  188. data: {
  189. columns: [
  190. // each columns data
  191. ['data1', 0, 9, 16, 19, 30, 25, 19, 12, 0],
  192. ],
  193. type: 'area-spline', // default type of chart
  194. groups: [
  195. ['data1', 'data2']
  196. ],
  197. colors: {
  198. data1: '#6c5ffc'
  199. },
  200. names: {
  201. // name of each serie
  202. 'data1': 'Maximum'
  203. }
  204. },
  205. axis: {
  206. x: {
  207. type: 'category',
  208. // name of each category
  209. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep']
  210. },
  211. },
  212. legend: {
  213. show: false, //hide legend
  214. },
  215. padding: {
  216. bottom: 0,
  217. top: 0
  218. },
  219. });
  220. /*chart-spline*/
  221. var chart = c3.generate({
  222. bindto: '#chart-spline', // id of chart wrapper
  223. data: {
  224. columns: [
  225. // each columns data
  226. ['data1', 0, 0, 0.2, 0.5, 0.6, 1.2, 2.5, 2.9, 4.5, 4.9, 5.2, 5.8, 6.5, 6.7, 7.4, 4.9, 6.4, 5.4, 10.8, 6.8, 5.2, 11.9],
  227. ['data2', 0, 0, 0, 0, 0.3, 0.2, 0.5, 0.6, 1.5, 1.8, 1.9, 2.5, 1.6, 3.8, 3.9, 3.6, 1.8, 1.8, 1.9, 2.8, 5.4, 7.8, 10.9]
  228. ],
  229. labels: true,
  230. type: 'spline', // default type of chart
  231. colors: {
  232. data1: '#6c5ffc',
  233. data2: '#05c3fb'
  234. },
  235. names: {
  236. // name of each serie
  237. 'data1': 'USA',
  238. 'data2': 'India'
  239. }
  240. },
  241. axis: {
  242. x: {
  243. type: 'category',
  244. // name of each category
  245. categories: ['May', 'June', 'July', 'Aug', 'Sep', 'Oct']
  246. },
  247. },
  248. legend: {
  249. show: false, //hide legend
  250. },
  251. padding: {
  252. bottom: 0,
  253. top: 0
  254. },
  255. });
  256. /*chart-spline-rotated*/
  257. var chart = c3.generate({
  258. bindto: '#chart-spline-rotated', // id of chart wrapper
  259. data: {
  260. columns: [
  261. // each columns data
  262. ['data1', 12, 7, 8, 6, 8, 9, 12],
  263. ['data2', 8, 10, 10, 9, 7, 10, 8]
  264. ],
  265. type: 'spline', // default type of chart
  266. colors: {
  267. data1: '#6c5ffc',
  268. data2: '#05c3fb'
  269. },
  270. names: {
  271. // name of each serie
  272. 'data1': 'Maximum',
  273. 'data2': 'Minimum'
  274. }
  275. },
  276. axis: {
  277. x: {
  278. type: 'category',
  279. // name of each category
  280. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
  281. },
  282. rotated: true,
  283. },
  284. legend: {
  285. show: false, //hide legend
  286. },
  287. padding: {
  288. bottom: 0,
  289. top: 0
  290. },
  291. });
  292. /*chart-step*/
  293. var chart = c3.generate({
  294. bindto: '#chart-step', // id of chart wrapper
  295. data: {
  296. columns: [
  297. // each columns data
  298. ['data1', 10, 15, 10, 18, 19, 15],
  299. ['data2', 7, 7, 5, 7, 9, 12]
  300. ],
  301. type: 'step', // default type of chart
  302. colors: {
  303. data1: '#6c5ffc',
  304. data2: '#05c3fb'
  305. },
  306. names: {
  307. // name of each serie
  308. 'data1': 'Maximum',
  309. 'data2': 'Minimum'
  310. }
  311. },
  312. axis: {
  313. x: {
  314. type: 'category',
  315. // name of each category
  316. categories: ['May', 'June', 'July', 'Aug', 'Sep', 'Oct']
  317. },
  318. },
  319. legend: {
  320. show: false, //hide legend
  321. },
  322. padding: {
  323. bottom: 0,
  324. top: 0
  325. },
  326. });
  327. /*chart-area-step*/
  328. var chart = c3.generate({
  329. bindto: '#chart-area-step', // id of chart wrapper
  330. data: {
  331. columns: [
  332. // each columns data
  333. ['data1', 15, 14, 18, 19, 20, 18],
  334. ['data2', 10, 10, 12, 14, 15, 13]
  335. ],
  336. type: 'area-step', // default type of chart
  337. colors: {
  338. data1: '#6c5ffc',
  339. data2: '#05c3fb'
  340. },
  341. names: {
  342. // name of each serie
  343. 'data1': 'Maximum',
  344. 'data2': 'Minimum'
  345. }
  346. },
  347. axis: {
  348. x: {
  349. type: 'category',
  350. // name of each category
  351. categories: ['May', 'June', 'July', 'Aug', 'Sep', 'Oct']
  352. },
  353. },
  354. legend: {
  355. show: false, //hide legend
  356. },
  357. padding: {
  358. bottom: 0,
  359. top: 0
  360. },
  361. });
  362. /*chart-bar*/
  363. var chart = c3.generate({
  364. bindto: '#chart-bar', // id of chart wrapper
  365. data: {
  366. columns: [
  367. // each columns data
  368. ['data1', 11, 8, 15, 18, 19, 17],
  369. ['data2', 7, 7, 5, 7, 9, 12]
  370. ],
  371. type: 'bar', // default type of chart
  372. colors: {
  373. data1: '#6c5ffc',
  374. data2: '#05c3fb'
  375. },
  376. names: {
  377. // name of each serie
  378. 'data1': 'Maximum',
  379. 'data2': 'Minimum'
  380. }
  381. },
  382. axis: {
  383. x: {
  384. type: 'category',
  385. // name of each category
  386. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
  387. },
  388. },
  389. bar: {
  390. width: 16
  391. },
  392. legend: {
  393. show: false, //hide legend
  394. },
  395. padding: {
  396. bottom: 0,
  397. top: 0
  398. },
  399. });
  400. /*chart-bar*/
  401. var chart = c3.generate({
  402. bindto: '#chart-monthly', // id of chart wrapper
  403. data: {
  404. columns: [
  405. // each columns data
  406. ['data1', 11, 8, 35, 18, 19, 17, 33, 39, 48, 57, 39, 63]
  407. ],
  408. type: 'bar', // default type of chart
  409. colors: {
  410. data1: '#6c5ffc'
  411. },
  412. names: {
  413. // name of each serie
  414. 'data1': 'Maximum'
  415. }
  416. },
  417. axis: {
  418. x: {
  419. type: 'category',
  420. // name of each category
  421. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  422. },
  423. },
  424. bar: {
  425. width: 30
  426. },
  427. legend: {
  428. show: false, //hide legend
  429. },
  430. padding: {
  431. bottom: 0,
  432. top: 0
  433. },
  434. });
  435. /*chart-bar-rotated*/
  436. var chart = c3.generate({
  437. bindto: '#chart-bar-rotated', // id of chart wrapper
  438. data: {
  439. columns: [
  440. // each columns data
  441. ['data1', 11, 8, 15, 18, 19, 17],
  442. ['data2', 7, 7, 5, 7, 9, 12]
  443. ],
  444. type: 'bar', // default type of chart
  445. colors: {
  446. data1: '#6c5ffc',
  447. data2: '#05c3fb'
  448. },
  449. names: {
  450. // name of each serie
  451. 'data1': 'Maximum',
  452. 'data2': 'Minimum'
  453. }
  454. },
  455. axis: {
  456. x: {
  457. type: 'category',
  458. // name of each category
  459. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
  460. },
  461. rotated: true,
  462. },
  463. bar: {
  464. width: 15
  465. },
  466. legend: {
  467. show: false, //hide legend
  468. },
  469. padding: {
  470. bottom: 0,
  471. top: 0
  472. },
  473. });
  474. /*chart-bar-stacked*/
  475. var chart = c3.generate({
  476. bindto: '#chart-bar-stacked', // id of chart wrapper
  477. data: {
  478. columns: [
  479. // each columns data
  480. ['data1', 11, 8, 15, 18, 19, 17, 20, 25, 32, 20, 14, 20],
  481. ['data2', 7, 7, 5, 7, 9, 12, 4, 6, 2, 5, 2, 8]
  482. ],
  483. type: 'bar', // default type of chart
  484. groups: [
  485. ['data1', 'data2']
  486. ],
  487. colors: {
  488. data1: '#6c5ffc',
  489. data2: '#05c3fb'
  490. },
  491. names: {
  492. // name of each serie
  493. 'data1': 'Maximum',
  494. 'data2': 'Minimum'
  495. }
  496. },
  497. axis: {
  498. x: {
  499. type: 'category',
  500. // name of each category
  501. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  502. },
  503. },
  504. bar: {
  505. width: 16
  506. },
  507. legend: {
  508. show: false, //hide legend
  509. },
  510. padding: {
  511. bottom: 0,
  512. top: 0
  513. },
  514. });
  515. /*chart-pie*/
  516. var chart = c3.generate({
  517. bindto: '#chart-pie', // id of chart wrapper
  518. data: {
  519. columns: [
  520. // each columns data
  521. ['data1', 63],
  522. ['data2', 44],
  523. ['data3', 12],
  524. ['data4', 14]
  525. ],
  526. type: 'pie', // default type of chart
  527. colors: {
  528. data1: '#6c5ffc',
  529. data2: '#05c3fb',
  530. data3: '#09ad95',
  531. data4: '#1170e4'
  532. },
  533. names: {
  534. // name of each serie
  535. 'data1': 'A',
  536. 'data2': 'B',
  537. 'data3': 'C',
  538. 'data4': 'D'
  539. }
  540. },
  541. axis: {},
  542. legend: {
  543. show: false, //hide legend
  544. },
  545. padding: {
  546. bottom: 0,
  547. top: 0
  548. },
  549. });
  550. /*chart-pie*/
  551. var chart = c3.generate({
  552. bindto: '#chart-pie2', // id of chart wrapper
  553. data: {
  554. columns: [
  555. // each columns data
  556. ['data1', 63],
  557. ['data2', 40],
  558. ['data3', 12],
  559. ['data4', 14],
  560. ['data5', 20],
  561. ['data6', 29],
  562. ],
  563. type: 'pie', // default type of chart
  564. colors: {
  565. 'data1': '#6c5ffc',
  566. 'data2': '#05c3fb',
  567. 'data3': '#09ad95',
  568. 'data4': '#1170e4',
  569. 'data5': '#f82649',
  570. 'data6': '#f7b731',
  571. },
  572. names: {
  573. // name of each serie
  574. 'data1': 'A',
  575. 'data2': 'B',
  576. 'data3': 'C',
  577. 'data4': 'D',
  578. 'data5': 'E',
  579. 'data6': 'F'
  580. }
  581. },
  582. axis: {},
  583. legend: {
  584. show: false, //hide legend
  585. },
  586. padding: {
  587. bottom: 0,
  588. top: 0
  589. },
  590. });
  591. /*chart-pie*/
  592. var chart = c3.generate({
  593. bindto: '#chart-pie3', // id of chart wrapper
  594. data: {
  595. columns: [
  596. // each columns data
  597. ['data1', 63],
  598. ['data2', 44],
  599. ['data3', 28]
  600. ],
  601. type: 'pie', // default type of chart
  602. colors: {
  603. 'data1': '#6c5ffc',
  604. 'data2': '#05c3fb',
  605. 'data3': '#09ad95'
  606. },
  607. names: {
  608. // name of each serie
  609. 'data1': 'A',
  610. 'data2': 'B',
  611. 'data3': 'C'
  612. }
  613. },
  614. axis: {},
  615. legend: {
  616. show: false, //hide legend
  617. },
  618. padding: {
  619. bottom: 0,
  620. top: 0
  621. },
  622. });
  623. /*chart-pie*/
  624. var chart = c3.generate({
  625. bindto: '#chart-pie4', // id of chart wrapper
  626. data: {
  627. columns: [
  628. // each columns data
  629. ['data1', 58],
  630. ['data2', 45],
  631. ['data3', 20],
  632. ['data4', 14]
  633. ],
  634. type: 'pie', // default type of chart
  635. colors: {
  636. 'data1': '#6c5ffc',
  637. 'data2': '#05c3fb',
  638. 'data3': '#09ad95',
  639. 'data4': '#1170e4'
  640. },
  641. names: {
  642. // name of each serie
  643. 'data1': 'A',
  644. 'data2': 'B',
  645. 'data3': 'C',
  646. 'data4': 'D'
  647. }
  648. },
  649. axis: {},
  650. legend: {
  651. show: false, //hide legend
  652. },
  653. padding: {
  654. bottom: 0,
  655. top: 0
  656. },
  657. });
  658. /*chart-donut*/
  659. var chart = c3.generate({
  660. bindto: '#chart-donut', // id of chart wrapper
  661. data: {
  662. columns: [
  663. // each columns data
  664. ['data1', 78],
  665. ['data2', 95],
  666. ['data3', 25],
  667. ],
  668. type: 'donut', // default type of chart
  669. colors: {
  670. data1: '#6c5ffc',
  671. data2: '#05c3fb',
  672. data3: '#09ad95',
  673. },
  674. names: {
  675. // name of each serie
  676. 'data1': 'sales1',
  677. 'data2': 'sales2',
  678. 'data3': 'sales3'
  679. }
  680. },
  681. axis: {},
  682. legend: {
  683. show: false, //hide legend
  684. },
  685. padding: {
  686. bottom: 0,
  687. top: 0
  688. },
  689. });
  690. /*chart-donut*/
  691. var chart = c3.generate({
  692. bindto: '#chart-donut2', // id of chart wrapper
  693. data: {
  694. columns: [
  695. // each columns data
  696. ['data1', 78],
  697. ['data2', 95],
  698. ['data3', 25],
  699. ['data4', 45],
  700. ['data5', 75],
  701. ['data6', 25],
  702. ],
  703. type: 'donut', // default type of chart
  704. colors: {
  705. 'data1': '#6c5ffc',
  706. 'data2': '#05c3fb',
  707. 'data3': '#09ad95',
  708. 'data4': '#1170e4',
  709. 'data5': '#f82649',
  710. 'data6': '#f7b731',
  711. },
  712. names: {
  713. // name of each serie
  714. 'data1': 'sales1',
  715. 'data2': 'sales2',
  716. 'data3': 'sales3',
  717. 'data4': 'sales4',
  718. 'data5': 'sales5',
  719. 'data6': 'sales6',
  720. }
  721. },
  722. axis: {},
  723. legend: {
  724. show: false, //hide legend
  725. },
  726. padding: {
  727. bottom: 0,
  728. top: 0
  729. },
  730. });
  731. /*chart-donut*/
  732. var chart = c3.generate({
  733. bindto: '#chart-donut3', // id of chart wrapper
  734. data: {
  735. columns: [
  736. // each columns data
  737. ['data1', 78],
  738. ['data2', 95]
  739. ],
  740. type: 'donut', // default type of chart
  741. colors: {
  742. 'data1': '#6c5ffc',
  743. 'data2': '#05c3fb',
  744. },
  745. names: {
  746. // name of each serie
  747. 'data1': 'sales1',
  748. 'data2': 'sales2'
  749. }
  750. },
  751. axis: {},
  752. legend: {
  753. show: false, //hide legend
  754. },
  755. padding: {
  756. bottom: 0,
  757. top: 0
  758. },
  759. });
  760. /*chart-donut*/
  761. var chart = c3.generate({
  762. bindto: '#chart-donut4', // id of chart wrapper
  763. data: {
  764. columns: [
  765. // each columns data
  766. ['data1', 78],
  767. ['data2', 95],
  768. ['data3', 25],
  769. ['data4', 45]
  770. ],
  771. type: 'donut', // default type of chart
  772. colors: {
  773. 'data1': '#6c5ffc',
  774. 'data2': '#05c3fb',
  775. 'data3': '#09ad95',
  776. 'data4': '#1170e4',
  777. },
  778. names: {
  779. // name of each serie
  780. 'data1': 'sales1',
  781. 'data2': 'sales2',
  782. 'data3': 'sales3',
  783. 'data4': 'sales4',
  784. }
  785. },
  786. axis: {},
  787. legend: {
  788. show: false, //hide legend
  789. },
  790. padding: {
  791. bottom: 0,
  792. top: 0
  793. },
  794. });
  795. /*chart-donut*/
  796. var chart = c3.generate({
  797. bindto: '#chart-donut5', // id of chart wrapper
  798. data: {
  799. columns: [
  800. // each columns data
  801. ['data1', 78],
  802. ['data2', 95],
  803. ['data3', 25],
  804. ['data4', 45]
  805. ],
  806. type: 'donut', // default type of chart
  807. colors: {
  808. 'data1': '#6c5ffc',
  809. 'data2': '#05c3fb',
  810. 'data3': '#09ad95',
  811. 'data4': '#1170e4',
  812. },
  813. names: {
  814. // name of each serie
  815. 'data1': 'USA',
  816. 'data2': 'Canada',
  817. 'data3': 'India',
  818. 'data4': 'France',
  819. }
  820. },
  821. axis: {},
  822. legend: {
  823. show: false, //hide legend
  824. },
  825. padding: {
  826. bottom: 0,
  827. top: 0
  828. },
  829. });
  830. /*chart-scatter*/
  831. var chart = c3.generate({
  832. bindto: '#chart-scatter', // id of chart wrapper
  833. data: {
  834. columns: [
  835. // each columns data
  836. ['data1', 11, 8, 15, 18, 19, 17],
  837. ['data2', 7, 7, 5, 7, 9, 12]
  838. ],
  839. type: 'scatter', // default type of chart
  840. colors: {
  841. data1: 'green',
  842. data2: 'red'
  843. },
  844. names: {
  845. // name of each serie
  846. 'data1': 'Maximum',
  847. 'data2': 'Minimum'
  848. }
  849. },
  850. axis: {
  851. x: {
  852. type: 'category',
  853. // name of each category
  854. categories: ['May', 'Jun', 'July', 'Aug', 'Sep', 'Oct']
  855. },
  856. },
  857. legend: {
  858. show: false, //hide legend
  859. },
  860. padding: {
  861. bottom: 0,
  862. top: 0
  863. },
  864. });
  865. /*chart-combination*/
  866. var chart = c3.generate({
  867. bindto: '#chart-combination', // id of chart wrapper
  868. data: {
  869. columns: [
  870. // each columns data
  871. ['data1', 100, 130, 150, 240, 130, 220],
  872. ['data2', 250, 200, 220, 400, 250, 350],
  873. ['data3', 100, 130, 150, 240, 130, 220]
  874. ],
  875. type: 'bar', // default type of chart
  876. types: {
  877. 'data1': "line",
  878. 'data2': "spline",
  879. },
  880. groups: [
  881. ['data3']
  882. ],
  883. colors: {
  884. data1: '#6c5ffc',
  885. data2: '#05c3fb',
  886. data3: '#09ad95'
  887. },
  888. color: function(color, d) {
  889. // d will be 'id' when called for legends
  890. return d.id && d.id === 'data3' ? d3.rgb(98, 89, 202) : color;
  891. //return d.id && d.id === 'data3' ? d3.rgb(98, 89, 202) :color;
  892. //return d.id && d.id === 'data3' ? d3.rgb(98, 89, 202).darker(d.value / 120) : color;
  893. },
  894. names: {
  895. // name of each serie
  896. 'data1': 'Marketing',
  897. 'data2': 'Development',
  898. 'data3': 'Sales'
  899. }
  900. },
  901. axis: {
  902. x: {
  903. type: 'category',
  904. // name of each category
  905. categories: ['2007-20082008', '2009-2010', '2011-2012', '2013-2014', '2015-2016', '2017-2018']
  906. },
  907. },
  908. bar: {
  909. width: 50
  910. },
  911. legend: {
  912. show: false, //hide legend
  913. },
  914. padding: {
  915. bottom: 0,
  916. top: 0
  917. },
  918. });
  919. /*chart-wrapper*/
  920. var chart = c3.generate({
  921. bindto: '#chart-wrapper', // id of chart wrapper
  922. data: {
  923. columns: [
  924. // each columns data
  925. ['data1', 7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6],
  926. ['data2', 3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
  927. ],
  928. labels: true,
  929. type: 'line', // default type of chart
  930. colors: {
  931. data1: 'purple',
  932. data2: 'pink'
  933. },
  934. names: {
  935. // name of each serie
  936. 'data1': 'Tokyo',
  937. 'data2': 'London'
  938. }
  939. },
  940. axis: {
  941. x: {
  942. type: 'category',
  943. // name of each category
  944. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
  945. },
  946. },
  947. legend: {
  948. show: false, //hide legend
  949. },
  950. padding: {
  951. bottom: 0,
  952. top: 0
  953. },
  954. });
  955. })(jQuery);