Skip to content

How to add different images (png, jpd or even webp) inside the point elements on scatter graphs? #11639

Discussion options

You must be logged in to vote

Thank you for your replay, it works indeed :) But i'm struggling to do this with multiple and dynamically created images (from links). Creating multiple images "by hand" as shown in that video seems repetitive to me.

Here is a more concrete example/pseudocode.

the pointStyle option accepts an array with multiple images as Image() constructor, not with just links - this is the first lesson I've learned :)

let imgArray = [];
let dataMockup = ['favicon1', 'favicon2', 'favicon3'];

dataMockup.forEach (image => {
let img = new Image (100, 100);
img.src = https://www.chartjs.org/docs/3.5.1/${image}.ico
console.log(img) // "< i mg width="100" height="100" src="https://www.chartjs.org/docs/3.5.1/f…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Udemology
Comment options

@SilviuGheorghe
Comment options

Answer selected by SilviuGheorghe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants