javascript - Highcharts - Display only one name at each end of the bar's chart -
i trying display 1 name @ each end of bar's chart. send data controller (i using zend) :
$chartsdata['project'][] = array('riri', 45); $chartsdata['project'][] = array('fifi', 120); $chartsdata['project'][] = array('loulou', 3); and got :
as can see, fine , data correct. except name @ end of bar. want show 1 name each bar (riri, fifi, loulou). presently, got in js file :
plotoptions: { bar: { color : '#4572a7', datalabels: { enabled: true, borderwidth: 0, format: '{series.name}' } } }, i try change value in {series.name} put {x} or {y} got number.
if can me on this, got gratitude
it's hard tell if you've set correct values within xaxis or yaxis or series, if have, need use formatter. try this:
plotoptions: { series: { datalabels: { enabled: true, formatter: function() { return this.x; } } } }, here's example fiddle: http://jsfiddle.net/jr79y/
Comments
Post a Comment