Axis breaking in highcharts waterfall for heavily skewed data

214 Views Asked by At

I am trying to build a waterfall chart which will have heavily skewed data(max 45000, min 4), to make the smaller values look significant amount and I am trying to break the yaxis to achieve that. However I am unable to find a generic logic as where exactly to break the yaxis so that the graph looks good for any data. Below is my code.

 yAxis: {
        title: {
            text: 'USD'
        },
                    // calculate percentage of first value for breaking
        breaks: [{
            from: data[0]*0.05, // break starts at 5% of 7311
            to: data[0] * 0.97 // and ends at 97% of 7311
        }],
        events: {
            pointBreak: pointBreakColumn
        }
    },

http://jsfiddle.net/Saibabu276/4cdrqnbj/61/

Also I am getting axis broken on the second bar in below case for the reason I couldn't figure out. Please Help!! enter image description here

1

There are 1 best solutions below

1
Sebastian Hajdus On

Setting the yAxis.type to logarithimic is the best way to work with skewed data.

Logarithmic axes can be useful when dealing with data with spikes or large value gaps, as they allow variance in the smaller values to remain visible.

More information with type scale use in charts, you can read on the Highcharts blog.