scale to fit/fill image as pointStyle in chartjs

162 Views Asked by At

is there a way to scale image to fit/fill in chartjs, image as pointStyle on chart, we can load an image but cant set it as fill or fit, we can only provide width, height to that image.

we can use image as pointStyle for a datapoint in line chart by sending an image object to the array of pointStyle in the dataset, in the image object we can only send height and width for the image to render on the point, my specific question is how can we scale image to fit or fill upon sending it to the pointStyle array to render as datapoint?

lets say i have a picture original at 200x200 we create an Image object of 100x100, can we specify the image to fit or fill that 100x100 we specified above as the image object.

the expected result should be like we can do in css “object-fit:fill” property on HTML hope the question is more clear now.

0

There are 0 best solutions below