First check whether the library you are using allow to perform such action or not.
Nov 24, 2021
4
Level 1
How to make a bubble chart using image as background with chartJS?
I am looking for solution to applied image on each bubble display. At the moment, it can only be displayed with background color.
I want attach each bubble with respective image url. Anyone have idea how to it can be done? Any solution to achieve?
<script>
import { Bubble } from 'vue-chartjs'
export default {
extends: Bubble,
data() {
return {
chartData: {
datasets: [{
label: 'Population Data',
borderWidth: 1,
borderColor: '#2554FF',
backgroundColor: '#2554FF',
data: [{
x: 6,
y: 3,
r: 15
}, {
x: 3,
y: 12,
r: 4
},
{
x: 5,
y: 15,
r: 10
},
{
x: 3,
y: 12,
r: 8
},
{
x: 4,
y: 5,
r: 20
},
{
x: 2,
y: 6,
r: 3
},
{
x: 4,
y: 9,
r: 11
},
{
x: 5,
y: 10,
r: 6
}
]
}]
},
options: {
legend: {
display: true
},
responsive: true,
maintainAspectRatio: false
}
}
},
mounted() {
this.renderChart(this.chartData, this.options)
}
}
</script>
<template>
<div>
<h3>Bubble Chart Example in Vue</h3>
<bubble-chart></bubble-chart>
</div>
</template>
<script>
import BubbleChart from '@/components/BubbleChart'
export default {
components: {
BubbleChart
}
}
</script>
Please or to participate in this conversation.