Note that there are some explanatory texts on larger screens.

plurals
  1. POHighcharts - Legend item padding
    primarykey
    data
    text
    <p>There seem to be a problem with the padding of text for label items in Highcharts. I get very different results in Firefox compared to Chrome: <a href="http://jsfiddle.net/moppa/cMXyG/18/" rel="nofollow noreferrer">http://jsfiddle.net/moppa/cMXyG/18/</a></p> <p><img src="https://i.stack.imgur.com/Aixo1.png" alt="Example of difference"></p> <p>If I inspect the elements in the browser the <strong>tspan</strong> tag has a height of 16px in Chrome, but 20px. In FF it looks like some pixels has been added as padding, since the text does not fill up the whole tag. I have experimented with line height and font-size settings of the <code>legend.itemStyle</code>, but no luck.</p> <p>Does anyone have any ideas? Firefox 25.0.1 and Chrome 31.0.1650.57m</p> <p>Attaching code to be compliant with the JSFiddle restriction:</p> <pre><code>var chart = new Highcharts.Chart({ chart: { renderTo: 'container' }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, legend: { layout: 'vertical', itemMarginTop: 0, itemMarginBottom: 0, align: 'right', verticalAlign: 'middle', padding:0 }, series: [{ 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]}, { 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]}, { 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]}, { 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]}, { 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]}, { 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]}] }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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