Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

How can I add an image in the layout of my chart?

how can I add an image in the layout of my chart? I work in Javascript and I try in this way:

var layout = {
images: [
{
source: ‘sfondo.png’,
xref : ‘x’,
yref: ‘y’,
x: 1,
y: 3,
sizex: 640,
sizey: 480,
sizing: ‘stretch’,
opacity : 0.4,
layer: ‘below’
}],

xaxis: {title: ‘coor_x’,
range:[0, 640],
},

yaxis: {title: ‘coor_Y’,
type: ‘linear’,
range: [0,480]
},

margin: {t: 20},
hovermode: ‘closest’,
rangemode:’ nonnegative’
};

The source field needs to be a http or https URL or a png data URI.