jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

treemap third level root on click

https://jsfiddle.net/2ydqujxz/13/

in the above example when i click on 'Chem' which is under basic Material, i would like to show directly as chem.. like breadcrumb would be
s&p 500 --> Basic Material --> chem and that would show children as 'IHJ' and 'FMH' .. if you look at the click event.. i am trying that. but its giving me error (second line commented which is throwing error)

how can i directly go to third level ?
Thanks
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: treemap third level root on click

Hello,

This was because Chem did not have this data assigned to it. They were in a variable that you haven't used anywhere.
Demo: https://jsfiddle.net/BlackLabel/2ryz73mf/

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: treemap third level root on click

Sorry for the confusion and mistake.. what actually i want is when i click on 'chem' i should only see that child like S&P 500 --> Basic Material--> chem -->IHJ and FMH.. and should not see 'Mining','Ag' and other categories..

and when i try to click on ' basic material' i should see all the children under..

i am trying to use setRootNode(..) but seems to be not working ..
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: treemap third level root on click

Hello,

Instead of setRootNode() method you can use onClickDrillToNode() method on the series passing the point you clicked on.
Demo: https://jsfiddle.net/BlackLabel/po1x3smd/

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Usage”