javascript - how to keep the y-axis labels in between the lines in HighChart plug in -
i using this plugin create chart .
i have :
and want:
how can this? references??
and here code chart
$(function () { $('#container').highcharts({ chart: { type: 'column', margin: [ 100] }, title: { text: 'world\'s largest cities per 2008' }, xaxis: { categories: personnamelist, labels: { rotation: -45, align: 'right', style: { fontsize: '13px', fontfamily: 'verdana, sans-serif' } } }, yaxis: { min: 0, title: { text: 'population (millions)' } }, legend: { enabled: false }, tooltip: { formatter: function() { return '<b>'+ this.x +'</b><br/>'+ 'population in 2008: '+ highcharts.numberformat(this.y, 1) + ' millions'; } }, series: [{ name: 'population', data: datalist, datalabels: { enabled: true, rotation: -90, color: '#ffffff', align: 'right', x: 4, y: 10, style: { fontsize: '13px', fontfamily: 'verdana, sans-serif' } } }] }); });
here 1 way accomplish this:
in labels
object within highcharts object, set y position, , rid of '0' this:
labels: { formatter: function() { if (this.value != 0) { return this.value; } else { return ''; } }, y: 40 }
using property, can change position [up or down] each label positioned. down-side 0 on y axis should removed.
Comments
Post a Comment