dario939
Posts: 3
Joined: Wed Oct 05, 2022 10:29 am

Link Format upside down

Hi everybody, i have this Network Graph https://jsfiddle.net/dario939/h4xmfdcL/1/.

As you can see the percentage on the links is always on top from the left to right node, so it seems "upside down" if the to node in the visualization is on the left and not on the right. How can i always show it not upside down? Any suggestions?

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

Re: Link Format upside down

Hello Dario,

This demo contains some custom wrap code which I don't know what exactly it does because after removing it I don't see any difference, but it overrides the default functionality of link positioning, so they are not displayed correctly.

By default, the graph behaves as you would expect it, so removing this wrap solves the problem.

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

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
dario939
Posts: 3
Joined: Wed Oct 05, 2022 10:29 am

Re: Link Format upside down

Hello, thanks for answering, i found that function here in this forum viewtopic.php?t=45331

It adds arrows at links, i need those arrows, so when i put them the labels are upside down. This is the code i need, with the arrows, i knew that without arrows everything worked. That's exactly what i need to figure out. https://jsfiddle.net/dario939/h4xmfdcL/
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Link Format upside down

Hi,

As you wrote it, I only saw that there are actually arrows. I analyzed the code comparing it to the original function that it overwrites and someone did not add one IF condition which was responsible for the correct positioning of the labels.

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

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
dario939
Posts: 3
Joined: Wed Oct 05, 2022 10:29 am

Re: Link Format upside down

Thanks for answering again, unfortanetly i already tried it as well but as you can see, this solution doesn't take in consideration anymore the true relations between nodes. In fact if you move the nodeto the left or the right of another linked node it als changes the arrow direction. I really don't know how to solve this.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Link Format upside down

Hello,

It was necessary to add the logic of checking whether the nodes are inverted and take it into account when drawing the line. Here comes another problem, the labels are centred based on the line length and if you draw the arrows are not in the center, you would have to override the function responsible for these calculations.

But it is starting to become a very custom functionality and it goes beyond the scope of the support. If you need help with your implementation, you can try to look for it on the more general forums like StackOverflow or contact the Black Label company that specializes in Highcharts custom projects. See the official Black Label site: https://blacklabel.pl

Demo: https://jsfiddle.net/BlackLabel/7mt5cz1g/

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

Return to “Highcharts Usage”