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.

heatmap.md 1.5 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ## Day-based Month-wise data
  2. The heatmap is a representation of day-wise data (similar to [the GitHub Contribution Graph]()). It spaces out data values linearly, across 5 levels (zero data kept exclusive).
  3. In this case, the data has three parts,
  4. ```js
  5. let data = {
  6. dataPoints: {
  7. "1426744959": 20,
  8. "1463673055": 113,
  9. "1476892421": 57,
  10. // ...
  11. },
  12. start: startDate, // a JS date object
  13. end: endDate
  14. }
  15. ```
  16. ```js
  17. let chart = new Chart("#heatmap", {
  18. type: 'heatmap',
  19. data: data,
  20. })
  21. ```
  22. <chart-demo data="heatmap-data" v-bind:config="{
  23. title: 'Monthly Distribution',
  24. type: 'heatmap',
  25. }">
  26. </chart-demo>
  27. <chart-demo data="heatmap-data" v-bind:config="{
  28. title: 'Monthly Distribution',
  29. type: 'heatmap',
  30. height: 200,
  31. discreteDomains: 1,
  32. countLabel: 'Level',
  33. colors: ['#ebedf0', '#c0ddf9', '#73b3f3', '#3886e1', '#17459e'],
  34. }"
  35. v-bind:options="[
  36. {
  37. name: 'Discrete domains',
  38. path: ['discreteDomains'],
  39. type: 'Boolean',
  40. // boolNames: ['Continuous', 'Discrete'],
  41. states: { 'Discrete': 1, 'Continuous': 0 }
  42. },
  43. {
  44. name: 'Colors',
  45. path: ['colors'],
  46. type: 'Array',
  47. states: {
  48. 'Green (Default)': [],
  49. 'Blue': ['#ebedf0', '#c0ddf9', '#73b3f3', '#3886e1', '#17459e'],
  50. 'Halloween': ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001c']
  51. }
  52. }
  53. ]">
  54. </chart-demo>
  55. (We are working on making the start date and end date implicit and optional). [tip]
  56. The chart is rendered by the type `heatmap`:
  57. ```js
  58. ```