confusedDude
Posts: 21
Joined: Wed Jul 27, 2022 9:31 am

Labels with formatter sticks

When i collapse my parent series, the labels from the childtasks stays on floting in the space where they was when the tasks was there.
Reopoing the parent series draws new labels, making those labels stick on top of the old ones. If i close and open the collapse it just draws and draws new labels on top of eachother.

dataLabels: [
{
enabled: true,
format: project.name,
align: 'left',
style: self.style
}, {
useHTML: true,
enabled: true,
formatter: () => {
const totalEstimate = project.hoursSpent + project.estimatedTimeToCompleteActivities;
const colorClass = totalEstimate > project.timeEstimation ? 'red' : 'green';
const explanation: string = totalEstimate > project.timeEstimation
? '| Need ' + (totalEstimate - project.timeEstimation) + ' more hours than estimated'
: '| Need ' + (project.timeEstimation - totalEstimate) + ' less hours than estimated'
;

return `<div>
<span style="
font-family: 'Inter', sans-serif;
font-size: 13px;
text-outline: none;
font-weight: 600;">
${project.hoursSpent} +
</span>
<span class="rn-timeline-label" style="
font-family: 'Inter', sans-serif;
font-size: 13px;
text-outline: none;
font-weight: 600;
color:${colorClass}">(${project.estimatedTimeToCompleteActivities})
</span>
<span style="
font-family: 'Inter', sans-serif;
font-size: 13px;
text-outline: none;
font-weight: 600;">
/ ${project.timeEstimation}
</span>
</div>`;
}
}],

Can you help me?
confusedDude
Posts: 21
Joined: Wed Jul 27, 2022 9:31 am

Re: Labels with formatter sticks

https://jsfiddle.net/p1myhLw7/47/

Example of the problem. Try opening and collapsing "In progress", you will se that labels of "Relocate Staff" will percist and just add new ones ontop of it
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Labels with formatter sticks

Hello,

Apparently, this is a bug in Gantt with collapsing points with multiple labels. It is best if you report this bug on Github Issues: https://github.com/highcharts/highchart ... new/choose

There you should get more information and a workaround if possible.

Feel free to ask any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Gantt”