RadialBar with Image in JavaScript
Using ApexCharts with JavaScript
This RadialBar with Image example uses ApexCharts.js directly in JavaScript, with no wrapper component.
Install it with npm install apexcharts, then mount the chart with new ApexCharts(element, options).render().
var options = {
series: [72],
chart: {
height: 350,
type: 'radialBar',
},
plotOptions: {
radialBar: {
hollow: {
margin: 15,
size: '70%',
image: '../../assets/images/clock.png',
imageWidth: 64,
imageHeight: 64,
imageClipped: false,
},
dataLabels: {
name: {
show: false,
color: '#fff',
},
value: {
show: true,
color: '#333',
offsetY: 70,
fontSize: '22px',
},
},
},
},
colors: ['#20E647'],
fill: {
type: 'solid',
},
stroke: {
lineCap: 'round',
},
labels: ['Time on Task'],
}
var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()