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.

96 lines
1.7KB

  1. <template>
  2. <base-material-card
  3. class="v-card--material-chart"
  4. v-bind="$attrs"
  5. v-on="$listeners"
  6. >
  7. <template #heading>
  8. <chartist
  9. :data="data"
  10. :event-handlers="eventHandlers"
  11. :options="options"
  12. :ratio="ratio"
  13. :responsive-options="responsiveOptions"
  14. :type="type"
  15. style="max-height: 150px;"
  16. />
  17. </template>
  18. <slot
  19. slot="reveal-actions"
  20. name="reveal-actions"
  21. />
  22. <slot />
  23. <slot
  24. slot="actions"
  25. name="actions"
  26. />
  27. </base-material-card>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'MaterialChartCard',
  32. inheritAttrs: false,
  33. props: {
  34. data: {
  35. type: Object,
  36. default: () => ({})
  37. },
  38. eventHandlers: {
  39. type: Array,
  40. default: () => ([])
  41. },
  42. options: {
  43. type: Object,
  44. default: () => ({})
  45. },
  46. ratio: {
  47. type: String,
  48. default: undefined
  49. },
  50. responsiveOptions: {
  51. type: Array,
  52. default: () => ([])
  53. },
  54. type: {
  55. type: String,
  56. required: true,
  57. validator: v => ['Bar', 'Line', 'Pie'].includes(v)
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="sass">
  63. .v-card--material-chart
  64. p
  65. color: #999
  66. .v-card--material__heading
  67. max-height: 185px
  68. .ct-label
  69. color: inherit
  70. opacity: .7
  71. font-size: 0.975rem
  72. font-weight: 100
  73. .ct-grid
  74. stroke: rgba(255, 255, 255, 0.2)
  75. .ct-series-a .ct-point,
  76. .ct-series-a .ct-line,
  77. .ct-series-a .ct-bar,
  78. .ct-series-a .ct-slice-donut
  79. stroke: rgba(255,255,255,.8)
  80. .ct-series-a .ct-slice-pie,
  81. .ct-series-a .ct-area
  82. fill: rgba(255,255,255,.4)
  83. </style>