score:1

Accepted answer

the problem is that vertical axis add space on the left size, but doesn't add on the bottom. i would wrap labels for a better readability: http://jsfiddle.net/w53woene/2/ - otherwise it may happen that you will have so long label that chart will get 0 pixels for plotting area.

if you really need non-wrapped text, then i would wrap axis.prototype. getoffset to add extra space:

(function(h) {
  h.wrap(h.axis.prototype, 'getoffset', function(p) {
    p.call(this);
    if (this.isxaxis) {

      var lasttick = this.tickpositions[this.tickpositions.length - 1],
        lastlabel = this.ticks[lasttick].label,
        height = lastlabel.getbbox(true).height;

      this.labeldiff = height - this.chart.marginbottom;
      if (this.labeldiff > this.chart.axisoffset[2]) {
        this.chart.axisoffset[2] = this.labeldiff;
      } else {
        this.labeldiff = 0;
      }
    } else {
      this.offset -= this.chart.xaxis[0].labeldiff;
    }
  });
})(highcharts)

and live demo: http://jsfiddle.net/vwegeuvy/


Related Query