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

179
Views
Why does one chart overlays another (chart.js)?

I wanted to create one chart and update type. But when I update pie chart type to bar both charts are visible

function rebuildExpensesChart(){
    let ct = document.getElementById("chartType").value

    ExpensesChartConfig.data.datasets = [{
        type: ct,
        //some code here...
    }]
    ExpensesChartConfig.data.labels = someLabels
    ExpensesChart.update()
    console.log(ExpensesChart)
}

How it looks

How it should look

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

0

I solved it with adding this:

    ExpensesChart.data = null
    ExpensesChart.options = null
    ExpensesChart.update()

before the main code

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!