Код: Выделить всё
Users
[list]
[*][url=#][/url]
[*][url=#][/url]
[/list]
if ($('#chart_6').length > 0) {
var BehpardakhtIcon = new Image();
BehpardakhtIcon.src = "~/images/Behpardakht.png";
BehpardakhtIcon.width = 22;
BehpardakhtIcon.height = 22;
var BehsazanIcon = new Image();
BehsazanIcon.src = "~/images/Behsazan.png";
BehsazanIcon.width = 22;
BehsazanIcon.height = 22;
const data = {
datasets: [{
data: [
{ x: 30, y: 50, r: 15 }
],
borderWidth: 2,
pointStyle: BehpardakhtIcon,
label: 'Company1',
hoverBorderWidth: 3,
}],
};
const config = {
type: 'bubble',
data: data,
options: {
scales: {
x: {
title: {
display: true,
text: 'x'
}
},
y: {
title: {
display: true,
text: 'y'
}
},
},
plugins: {
tooltip: { intersect: true },
afterUpdate: function (chart, options) {
chart.getDatasetMeta(0).data.forEach((d, i) => {
d._model.pointStyle = BehpardakhtIcon;
})
}
},
},
};
const myBubbleChart =
new Chart(document.getElementById('chart_6'), config);
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... js-bubbles