eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Event for unclick in gantt highchart

Hi

I am using
click: (event: any) => {
let selectedPoints = event.point;
if (selectedPoints !== undefined) {
this.disableBtns = false;
}
},


unselect: (event: any) => {
this.disableBtns = true;
}
},

in the first time when i click points my disableBtns is assigned value as false but when i deselect the evnt is not firing.

is there any other method?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Event for unclick in gantt highchart

Hi eraka!

Select and unselect events are available on point object. I see, that you are taking the clicked point from event, so I assume, you are using events from the series object which is not correct. Also, you should enable allowPointSelect property to make this feature work. Furthermore, I think it will be better to use select event, instead of click, which will be called also on unclick event. I have prepared a simple demo for your - please check it below. Also, I recommend reading some docs - links below.

Demo: https://jsfiddle.net/BlackLabel/w8bdyevn/
API Reference: https://api.highcharts.com/gantt/series ... nts.select
https://api.highcharts.com/gantt/series ... s.unselect
https://api.highcharts.com/gantt/plotOp ... ointSelect

Feel free to ask any further questions!
Kind regards!
Hubert Kozik
Highcharts Developer
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: Event for unclick in gantt highchart

thanks it worked on the same location, i was using plotOptions.series.point.event .

i blv it worked let selectedPoints = event.target; earlier i was using point in place of target... thank u fot the docs..
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Event for unclick in gantt highchart

That's great to hear! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: Event for unclick in gantt highchart

Hi

in the attached fiddle when we select data point it shows gray in color can we change it to the color of the bar selected, if we select blue bar then on selection its color be lighblue and on select of green color point it be light green, like that or on selection how can we change the color?
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: Event for unclick in gantt highchart

I am able to change the point color on select can we change datalabel color as well on selecting point item?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Event for unclick in gantt highchart

eraka,
To change the font color of dataLabels just add point.update method when events select, unselect are fired.

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

Regards!
Hubert Kozik
Highcharts Developer
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: Event for unclick in gantt highchart

thanks
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Event for unclick in gantt highchart

You're welcome! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer

Return to “Highcharts Gantt”