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.

46 lines
778 B

  1. <script>
  2. import { HorizontalBar, mixins } from 'vue-chartjs'
  3. const { reactiveProp } = mixins
  4. export default {
  5. extends: HorizontalBar,
  6. mixins: [reactiveProp],
  7. props: {
  8. chartData: {
  9. type: Object,
  10. default: () => {},
  11. required: true
  12. }
  13. },
  14. data() {
  15. return {
  16. options: {
  17. scales: {
  18. yAxes: [
  19. {
  20. barPercentage: 0.3
  21. }
  22. ],
  23. xAxes: [
  24. {
  25. ticks: {
  26. beginAtZero: true,
  27. min: 0
  28. }
  29. }
  30. ]
  31. },
  32. maintainAspectRatio: false,
  33. legend: {
  34. display: false
  35. }
  36. }
  37. }
  38. },
  39. mounted() {
  40. this.renderChart(this.chartData, this.options)
  41. }
  42. }
  43. </script>