Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>By default it's not supported, but you can use simple workaround for this, see: <a href="http://jsfiddle.net/Le4Vc/4/" rel="nofollow">http://jsfiddle.net/Le4Vc/4/</a></p> <pre><code>$('#container').highcharts({ chart: { events: { load: function() { var chart = this; $.each(chart.legend.allItems, function(i, item){ var $check = $(item.checkbox), left = parseFloat($check.css('left')), label = item.legendItem, static = 30; $check.css({ left: (left - label.bBox.width - static) + 'px' }); }); } } }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, plotOptions: { series: { marker: { enabled: false }, allowPointSelect: true, showCheckbox: true } }, legend: { symbolPadding: 20, symbolWidth: 0 }, series: [{ name: 's 1', data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] },{ name: 'another name', data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4].sort(function(a,b) { return a - b; }) }] }); </code></pre> <p><strong>Edit:</strong> Another solution, more universal is to wrap <code>positionCheckboxes</code> function. For example: </p> <pre><code>(function (H) { H.wrap(H.Legend.prototype, 'positionCheckboxes', function (p, scrollOffset) { var alignAttr = this.group.alignAttr, translateY, clipHeight = this.clipHeight || this.legendHeight; if (alignAttr) { translateY = alignAttr.translateY; H.each(this.allItems, function (item) { var checkbox = item.checkbox, bBox = item.legendItem.bBox, top; if (checkbox) { top = (translateY + checkbox.y + (scrollOffset || 0) + 3); H.css(checkbox, { left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 60 - bBox.width) + 'px', top: top + 'px', display: top &gt; translateY - 6 &amp;&amp; top &lt; translateY + clipHeight - 6 ? '' : 'none' }); } }); } }); })(Highcharts); </code></pre> <p>And demo: <a href="http://jsfiddle.net/Le4Vc/85/" rel="nofollow">http://jsfiddle.net/Le4Vc/85/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload