StreetJimmy
Posts: 1
Joined: Mon Nov 01, 2021 2:13 pm

Update Gantt Series complete dynamically with the id

Hi,

I need help with updating the Gantt chart series complete after rendering with an button click event for example with the below I want to be able to increment the completed with 10 % every time I click the button for that specific id that was used open creation

var chart = Highcharts.ganttChart('container', {
pathfinder: {
lineColor: 'black',
marker: {
color: 'black'
}
},
plotOptions: {
series: {
animation: false
}
},
series: [{
name: 'P 1',
data: [
{
id: 'p1',
name: 'Plate 1',
dependency: '',
pointWidth: '2',
},
{
completed: 0.35,
id: '1141',
name: 'Sleep 2 seconds',
start: moment.utc('1/1/0001 00:00:00').valueOf(),
end: moment.utc('1/1/0001 00:00:02').valueOf(),
dependency: '',
parent: 'p1',
}
]
}, {
}]
});

Best Regards
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Update Gantt Series complete dynamically with the id

Hi,

Welcome to our forum and thanks for contacting us with your question!

If I understand it correctly, it can be done without a problem. You can do it in such a way that on the basis of the ID you search for a point in the data array and update it using the update() method.

Demo: https://jsfiddle.net/BlackLabel/qvr8ukha/

Let me know if that was what you were looking for!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Gantt”