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

310
Views
Hide Legend in Chart.js V3.7.1

I'm trying to hide the legend of a bar chart. Based on my understanding this should work:

<!DOCTYPE html>
<html>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.js"></script>
<body>

<canvas id="myChart" style="width:100%;max-width:600px"></canvas>

<script>
var xValues = ["X", "Y", "Z"];
var yValues = [55, 49, 44];
var barColors = ["red", "green","blue"];

new Chart("myChart", {
  type: "bar",
  data: {
    labels: xValues,
    datasets: [{
      backgroundColor: barColors,
      data: yValues
    }]
  },
  options: {
    plugings: {
        legend: {
            display: false
        },
    },
  },
});
</script>

</body>
</html>

Unfortunately it still does show a lengend.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You have a typo in plugins. Change "plugings" to "plugins"

options: {
    plugins: {
        legend: {
            display: false
        },
    },
  }

Other than that it should be correct

about 4 years ago · Santiago Gelvez 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!