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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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.

You Might Also Like