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

405
Views
Chartjs : Can I overwrite bar value on hover for every bar chart

I am using a simple bar chart from chartJS representing time passed (in seconds). I was wondering if I could overwrite every bar's value to an array I could provide. So instead of having 10983 I could write whatever I want, like 03:03:03 and another hh:mm:ss for the second bar and so forth.

Does anyone have an idea ?

Here is the chart I have so far Example


dataset = [{
    data: arrayData,
    backgroundColor : "#265d96" //#3e95cd //#265d96
  }];

  param = {
    type: "bar",
    data: {
      datasets: dataset,
      labels: arrayDesc
    },
    options: {
      responsive: true,
      maintainAspectRatio: true,
      scales: {
        yAxes: [{
          ticks: {
            beginAtZero:true
          }
        }]
      },
      legend: {
        display: false
      },
      tooltips: {
        enabled: true
      },
      animation: {
        animateScale: true,
        animateRotate: true
      },
      plugins:{
        labels:
        {
          render: () =>{},
          display : false
        }
      }
    }
  };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use a custom tooltip callback:

tooltips: {
  callbacks: {
    label: (ttItem) => (new Date(ttItem.yLabel*1000).toISOString().substring(11, 19))
  }
}
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!