Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

359
Views
Hacer que el gráfico de Vue-ECharts encaje en vuetify v-card

Estoy tratando desesperadamente de hacer que vue-echart funcione dentro de un componente v-card de vuetify.

De alguna manera, no puedo ajustar el tamaño del lienzo en el que se dibuja el gráfico para que quepa dentro de la tarjeta virtual. De alguna manera excede la tarjeta . He estado buscando durante días y no encontré una solución adecuada. ¿Hay alguna manera de hacer funcionar esto? Lo extraño es que tan pronto como coloco el elemento del gráfico en un div o contenedor, aparece un error quejándose de Can't get DOM width or height .

Aquí hay una versión simplificada de mi código:

 <template> <v-app> <v-main> <v-container> <v-row> <v-col class="col-3"> <v-card class="mx-auto" height="500" outlined elevation="2"> <v-card-title class="text-h5 font-weight-bold" >Registrations</v-card-title > <v-card-subtitle >Number of participants registered per profession</v-card-subtitle > <!-- <v-container> --> <chart :option="chartOptions" class="ma-10"></chart> <!-- </v-container> --> </v-card> </v-col> </v-row> </v-container> </v-main> </v-app> </template> <script> export default { name: "App", components: {}, data() { return { chartOptions: null, number_of_professors: 30, number_of_doctors: 50, number_of_other: 20, }; }, mounted() { this.chartOptions = { color: ["#EF5350", "#29B6F6", "#FFCA28"], width: "100%", height: "100%", legend: { orient: "vertical", y: "top", x: "left", data: ["professor", "doctor", "other"], }, series: [ { type: "pie", data: [ { name: "professor", value: this.number_of_professors }, { name: "doctor", value: this.number_of_doctors }, { name: "other", value: this.number_of_other }, ], radius: ["30%", "80%"], avoidLabelOverlap: false, label: { show: false, position: "center", }, labelLine: { show: false, }, }, ], }; }, }; </script>

Gracias por tu ayuda.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 var myChartCompleted = this.$echarts.init(this.$refs.Finish); myChartCompleted.setOption(this.optionCompleted) myChartCompleted._dom.childNodes[0].childNodes[0].style.height="290px" myChartCompleted._dom.childNodes[0].childNodes[0].style.width="180px"

Puede utilizar este método para obtener el nodo DOM del lienzo utilizado por echarts y asignar valores a sus propiedades. Si desea manipular otras propiedades del mismo, puede imprimir este nodo y ver :) (Traductor de Google)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!