您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

aggr_sliced_diags.md 2.2 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ## Also called Sliced Diagrams
  2. Another family of charts, the aggregation charts accumulate the value at a data point across the multiple datasets.
  3. **The data format stays the same, with single or multi datasets.**
  4. #### Pie chart
  5. Perhaps the most well-known representation of data slices are Pie charts:
  6. ```js
  7. type: 'pie'
  8. ```
  9. <chart-demo data="mixed-2" v-bind:config="{
  10. type: 'pie',
  11. height: 300
  12. }">
  13. </chart-demo>
  14. #### Percentage Charts FTW
  15. Pies have received some [criticism]() for data perception; we are much better at parsing sizes in a single dimension rather than an area. That's why, the much leaner `percentage` chart can come in handy:
  16. ```js
  17. type: 'percentage'
  18. ```
  19. <chart-demo data="mixed-2" v-bind:config="{
  20. type: 'percentage',
  21. height: 180,
  22. }">
  23. </chart-demo>
  24. #### Limiting the slices
  25. When there are too many data values to show visually, it makes sense to bundle up the least of the values as a cumulated data point, rather than showing tiny slices. This can be done by defining the maximum number of slices to be shown.
  26. ```js
  27. maxSlices: 7,
  28. ```
  29. <chart-demo data="mixed-2" v-bind:config="{
  30. type: 'pie',
  31. height: 300,
  32. maxSlices: 7,
  33. }"
  34. v-bind:options="[
  35. {
  36. name: 'maxSlices',
  37. path: ['maxSlices'],
  38. type: 'number',
  39. numberOptions: { min: 5, max: 8, step: 1 },
  40. activeState: 7
  41. }
  42. ]">
  43. </chart-demo>
  44. #### Configuring percentage bars
  45. Some attributes of a percentage bar can be redefined; like its height and the depth of it's shadow.
  46. ```js
  47. barOptions: {
  48. height: 15, // default: 20
  49. depth: 5 // default: 2
  50. }
  51. ```
  52. <chart-demo data="mixed-2" v-bind:config="{
  53. type: 'percentage',
  54. height: 200,
  55. barOptions: {
  56. height: 15,
  57. depth: 5
  58. }
  59. }"
  60. v-bind:options="[
  61. {
  62. name: 'barOptions',
  63. path: ['barOptions', 'depth'],
  64. type: 'number',
  65. numberOptions: { min: 1, max: 10, step: 1 },
  66. activeState: 5
  67. },
  68. {
  69. name: 'barOptions',
  70. path: ['barOptions', 'height'],
  71. type: 'number',
  72. numberOptions: { min: 11, max: 31, step: 2 },
  73. activeState: 15
  74. }
  75. ]">
  76. </chart-demo>