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

treemap drill down load data async..

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

in above example if i click on 'chem' then i would like to load ajax data under that node and drill down only to see that node..
something like below screenshot. i tried doing series.update or series.addPoint.. but none of them is working..
sample.png
sample.png (78.05 KiB) Viewed 428 times
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: treemap drill down load data async..

Hello,

There is already such a topic in the forum: viewtopic.php?t=40416

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: treemap drill down load data async..

i am aware of that link.. i already tried to implement.. but by using 'setData(..)' it will replace the existing series's data.. and that would not work since user can zoom out (breadcrumb) to look at the parent..

is there a solution without using setData...?
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: treemap drill down load data async..

Hi,

I was trying to reproduce this, but in my case everything is working correctly.
Demo: https://jsfiddle.net/BlackLabel/14rgtvb8/

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

Re: treemap drill down load data async..

thanks for response. i see why it was not working for my case.. i was replacing data.. with subData which only has data for category *chem*.. but when i marge original data and subData.. setData would work with breadcrumb and all..
so can i do something like series.addPoint({
id:'IHJ',name:'IHJ',parent:'Chem'}) .. instead of series.setData(..) ?

thanks again
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: treemap drill down load data async..

Hi,

Yes, you can use series.addPoint() method but then you have to add some logic to avoid duplicating points.
Demo: https://jsfiddle.net/BlackLabel/85gevykx/

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

Return to “Highcharts Usage”