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

442
Views
¿Cómo ocultar la leyenda de Chart.js en Vue?

Estoy usando Vue Chart.js para crear gráficos en mis proyectos. Traté de ocultar la leyenda, pero parece que no reconoce mi comando display:false. Traté de usar el ejemplo que ofrecieron en su repositorio de github. Los datos del gráfico se cargan correctamente. ¿Estoy haciendo algo mal? (Yo uso Vue 2).

 <template> <Bar :chart-options="chartOptions" :chart-data="chartData" :width="width" :height="height" /> </template> <script> import {Bar} from 'vue-chartjs/legacy' import {Chart as ChartJS, Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale} from 'chart.js' ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale) export default { name: 'MyBarChart', components: {Bar}, props: { chartId: { type: String, default: 'bar-chart' }, datasetIdKey: { type: String, default: 'label' }, width: { type: Number, default: 400 }, height: { type: Number, default: 200 }, chartData:{ type: Object, default: () => { } } }, data() { return { chartOptions: { responsive: true, legend: { display: false } } } }, } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

legend es un complemento para gráficos, por lo que estará debajo de los plugins en las opciones.

 options: { plugins: { legend: { display: false } } }
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!