Get X. getPixelForValue(i) in a Chartjs Plugin with a Time Type Scale

I have a barchart with chartjs. The x scale is of type: time, data/ticks represented hourly. I wrote a cutom plugin that draws something on canvas. Unfortunately I always get a -32768 for x.getPixelForValue(i), the y.getPixelForValue(i) seems fine. Am I missed something important or chartjs doesn`t support getPixelForValue on time series bar charts?

1 Answer

In the meantime I figured out the issue... The x.getPixelForTick(i) function returns the correct x coordinate for the bars.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest