Search code examples
highchartsangular2-highcharts

sanky highchart ~ how to remove blank space for hidden node


highchart type : sanky

here looking for a solution to remove the blank space for hidden node of snaky chart. as per the below screen shot with step0 chart is peroper

enter image description here

but after hiding the first node, there is blank space on left side. how can remove the blank space . i have tried by adding negative left margin but this is not working for all screen size.

enter image description here

Is it possible to remove this extra spaces?

hiding node using below code:

nodes[0].graphic.hide();
nodes[0].dataLabel.hide();
nodes[0].visible = false;
nodes[0].linksFrom[0].graphic.hide();

solution should not remove the unused representation enter image description here


Solution

  • You can remove the point and hide the remaining node graphic. For example:

    const series = chart.series[0];
    
    series.points[0].remove(true, false);
    series.nodes[0].graphic.hide();
    

    Live demo: https://jsfiddle.net/BlackLabel/n9jspzt1/

    API Reference: https://api.highcharts.com/class-reference/Highcharts.Point#remove