arifba
Posts: 7
Joined: Wed Jan 26, 2011 11:32 pm

Capturing click event for whole chart, including title?

Hi there,

I'm trying to capture the click event for the whole chart including the title. Is this possible? I can get close by capturing the click on the series as well as the chart, however the title remains uncaptured. And actually for that matter, the axes labels also remain uncaptured. I basically want to hyperlink the whole chart but so far, I can't figure it out.
See here: http://jsfiddle.net/arifba/Abkhz/

Thanks for looking.
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

Re: Capturing click event for whole chart, including title?

The easiest way to do this is to add a click event listener to the container div.
Torstein Hønsi
CTO, Founder
Highsoft
arifba
Posts: 7
Joined: Wed Jan 26, 2011 11:32 pm

Re: Capturing click event for whole chart, including title?

torstein.honsi wrote:The easiest way to do this is to add a click event listener to the container div.
Simple as it sounds, couldn't make the above suggestion work. Used a bit more of a complicated method overlaying the anchor block on top of the chart using a callback, see here:
http://fiddle.jshell.net/arifba/gKGqS/
LexGixxer
Posts: 1
Joined: Tue Aug 02, 2022 1:55 pm

Re: Capturing click event for whole chart, including title?

I know this is an old post, but for anyone else looking for this, I found it in the plot options click event.

Code: Select all

plotOptions:{
	pie:{
		events:{
			click:function(e){
				console.log(this.chart.title.textStr, this.chart.subtitle.textStr);
			}
		}
	}
}
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Capturing click event for whole chart, including title?

Hi there,

Welcome to our forum and thank you for posting your solution.

In case of any questions related to Highcharts functionality, feel free to contact us.
Best regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”