3

Consider the following high chart

enter image description here

At 15 jun, category II has no data, what if I dont want that spacing left for it, Is there anyway to remove such spaces.

for code reference

`http://jsfiddle.net/G5S9L/8/`
Raza
  • 2,320
  • 2
  • 22
  • 32

2 Answers2

3

I don't see anything in the API that allows you to do this. As a kludgy workaround you could shift the columns yourself in the onload callback:

, function(chart){
    var barLeft = $(chart.series[0].data[1].graphic.element);
    var barRight = $(chart.series[2].data[1].graphic.element);
    barLeft.attr('x',parseInt(barLeft.attr('x')) + parseInt(barLeft.attr('width'))/2);
    barRight.attr('x',parseInt(barRight.attr('x')) - parseInt(barRight.attr('width'))/2);
});

Updated fiddle.

Mark
  • 106,305
  • 20
  • 172
  • 230
2

This is how Highcharts work. It calculates the space for categories, then divide it between series. It doesn't matter if you have data or not, space is given for possible points.

Raein Hashemi
  • 3,346
  • 4
  • 22
  • 33