Highchart bubble cut off with max x/yAxis -


i need have bubble chart xaxis , yaxis 0 5. if have bubble on xaxis or yaxis 5, bubble cut of.

$(function () {     $('#container').highcharts({          chart: {             type: 'bubble',             zoomtype: 'xy',             height: 500,             width: 500,         },         title: {             text: 'highcharts bubbles'         },         yaxis: {             min: 0,              max: 5,             gridlinewidth: 1,         },         xaxis: {             min: 0,              max: 5,             gridlinewidth: 1,         },         series: [{             data: [[5, 4, 2], [3, 1, 1], [4, 2, 3], [1, 2, 3], [1, 4, 1], [2, 5, 1], [5, 2, 3], [3, 2, 1]]         }]     }); }); 

http://jsfiddle.net/tum3zzzu/1/

i somehow found trick doing max: 5.5 work xaxis. on yaxis max: 5.5 rounded 6.

how can solve problem?

you can use tickpositioner tell chart show ticks. used showlastlabel: false hide last tick (which 5.5). here's can in code:

yaxis: {     min: 0,      max: 5.5,     endontick: true,     showlastlabel: false,        // hide 5.5     gridlinewidth: 1,     tickpositioner: function() {          var positions = [0],     // start 0             tick = math.floor(this.datamin),             increment = math.ceil((this.datamax - this.datamin) / 6);          (tick; tick - increment < this.datamax; tick += increment) {             positions.push(tick);         }          positions.push(this.datamax + 0.5); // add last label 5.5          return positions;     } } 

and here's demo.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -