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

266
Views
El gráfico es demasiado grande. ¿Cómo puedo reducir el tamaño del gráfico en vue js?

He incrustado un gráfico de líneas del gráfico JS en el proyecto vue js. Sin embargo, mi gráfico es demasiado grande para mi página. ¿Cómo puedo hacer que parezca pequeño y compacto en mi página web? Esta es la primera vez que agrego gráficos a vue js. Cualquier consejo o consejo será muy útil para mí. Gracias. Aquí está mi código.

 <script> import { Line , mixins } from 'vue-chartjs'; import Chart from "chart.js"; export default { extends: Line, mixins: [mixins.reactiveProp], props: ["options"], data: () => ({ chartdata: { labels: ["Oct 2021", "Nov2021", "Nov2021", "Nov2021", "Nov2021","Nov2021","Nov2021","Nov2021"], datasets: [ { data: [0, 3.2, 0.2,5.9, 7.9, 6, 5.5, 4.2, 4.2, 3.8,3.8,3.8,2], label: "Critical", backgroundColor: "rgb(226,135,67)", borderColor: "#e28743", borderWidth: 3, }, { data: [0, 6.3, 0.5, 6, 7.9, 9, 9.8, 10, 11.3, 15], label: "High", backgroundColor: "rgb(234,182,118)", borderColor: "#eab676", borderWidth: 3, }, { data: [0, 0, 0, 0, 0, 0, 0.1, 0.1, 0, 0], label: "Low", backgroundColor: "rgb(38, 177, 212)", borderColor: "#26b1d4", borderWidth: 3, }, ], }, options: { responsive: true, maintainAspectRatio: false, lineTension: 1, scales: { yAxes: [ { ticks: { beginAtZero: true, padding:20, } } ] } }, }), mounted() { window.dispatchEvent(new Event("resize")); this.renderChart( this.chartdata, this.options, // this.textCenter(" Hello world ") ); // this.renderChart(this.chartdata, this.options) }, }; </script>

Cualquier consejo o consejo será muy útil para mí. Gracias.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Deberá envolver ese componente Vue en otro componente. En ese otro componente, puede establecer una altura y con el div en el que se encuentra su componente de gráfico.

over 4 years ago · Santiago Trujillo 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!