For my custom use, I needed to add a property 'icon' to the 'point' object in order to show birthdays with a gif as a dataLabels.
With the attached jsfiddle, it seems to work fine, however using the exactly the same 'dataLabels' code , I loose the hovering feature when hovering just over the image.
Any tips on what I could be doing wrong here? Is there any oher Highcharts feature that could in conflict?
Many thanks!
Code: Select all
Highcharts.ganttChart('container', {
title: {
text: 'Highcharts Gantt Chart'
},
subtitle: {
text: 'With custom symbols in data labels'
},
xAxis: {
minPadding: 0.05,
maxPadding: 0.05
},
yAxis: {
categories: ['Prototyping', 'Development', 'Testing']
},
tooltip: {
outside: true
},
accessibility: {
point: {
valueDescriptionFormat: '{point.yCategory}, assigned to {point.assignee} from {point.x:%Y-%m-%d} to {point.x2:%Y-%m-%d}.'
}
},
lang: {
accessibility: {
axis: {
xAxisDescriptionPlural: 'The chart has a two-part X axis showing time in both week numbers and days.'
}
}
},
series: [{
name: 'Project 1',
data: [{
start: Date.UTC(2018, 11, 1),
end: Date.UTC(2018, 11, 2),
y: 0,
assignee: 'bre1470'
}, {
start: Date.UTC(2018, 11, 2),
end: Date.UTC(2018, 11, 5),
y: 1,
assignee: 'oysteinmoseng',
fontSymbol: 'exclamation',
accessibility: {
description: 'Exclamation symbol.'
}
}, {
start: Date.UTC(2018, 11, 8),
end: Date.UTC(2018, 11, 9),
y: 2,
assignee: 'birthday-cake_1f382'
}, {
start: Date.UTC(2018, 11, 9),
end: Date.UTC(2018, 11, 19),
y: 1,
assignee: 'bre1470'
}, {
start: Date.UTC(2018, 11, 10),
end: Date.UTC(2018, 11, 23),
y: 2,
icon: 'https://em-content.zobj.net/source/microsoft-teams/363/birthday-cake_1f382.png',
fontSymbol: 'smile-o',
accessibility: {
description: 'Smiling face symbol.'
}
}],
dataLabels: [{
enabled: true,
format: '<div style="width: 20px; height: 20px; overflow: hidden; border-radius: 50%; margin-left: -25px">' +
'<img src="{point.icon}" ' +
'style="width: 30px; margin-left: -5px; margin-top: -2px"></div>',
useHTML: true,
align: 'left'
}, {
enabled: true,
format: '<i class="fa fa-{point.fontSymbol}" style="font-size: 1.5em"></i>',
useHTML: true,
align: 'right'
}]
}]
});