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

244
Views
chart.js API returns bad x and y points

I am calling my bubbleChart via chart.js API and trying to access x,y values of points but I get this very strange behavior

console.log(bubbleChart._metasets[1].data)
console.log(bubbleChart._metasets[1].data[0])

enter image description here

when I access object.x or object.y I get those 350.017 and 537.199 for every point even in console it shows x,y with correct values. What is going on?

of course I tried also this, but same result

bubbleChart.getDatasetMeta(1).data[0]

here is the fiddle which show strange behavior console.log shows always same data for different endpoints but if you put in console bubbleChart._metasets it shows correct x,y values

https://jsfiddle.net/vxb792pe/

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

0

actually I found a workaround

var xAxis = bubbleChart.scales['x'];
var yAxis = bubbleChart.scales['y'];

pointx = xAxis.getPixelForValue(bubbleChart.data.datasets[i].data[0].x)
pointy = yAxis.getPixelForValue(bubbleChart.data.datasets[i].data[0].y)
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!