user2317558
user2317558

Reputation: 264

Highcharts pie legend clipped off

When the Pie chart legend is paginated, the legend items on the first line of the legend are not fully displayed, it is clipped off

Here's the fiddle for it, with the code here:

function(){
    $('#container').highcharts({
       credits:{
          enabled:false
       },
       legend:{
          itemStyle:{
             fontFamily:'Arial',
             fontSize:'10pt'
          },
          maxHeight:55,
       },
       tooltip:{
          style:{
             fontFamily:'Arial',
             fontSize:'10pt'
          }
       },
       title:{
          style:{
             color:'#000000',
             fontFamily:'Arial'
          },
          text:'Pie legend problem',
          margin:50
       },
       chart:{
          renderTo:'container'
       },
       series:[
          {
             name:'Incident',
             type:'pie',
             data:[
                {
                   name:'Nadia Wilshire',
                   y:49,
                   color:'#73a8f0'
                },
                {
                   name:'ITIL User',
                   y:15,
                   color:'#318047'
                },
                {
                   name:'David Luie',
                   y:9,
                   color:'#f5c533',
                },
                {
                   name:'Don Godfire',
                   y:7,
                   color:'#004789',
                },
                {
                   name:'Bethline Angleen',
                   y:5,
                   color:'#f18320',
                },
                {
                   name:'Howard Johnwind',
                   y:3,
                   color:'#8f5699',
                },
                {
                   name:'Luke Smith',
                   y:3,
                   color:'#1e90ff',
                },
                {
                   name:'(empty)',
                   y:2,
                   color:'#3ed662',
                },
                {
                   name:'(empty2)',
                   y:2,
                   color:'#3ed662',
                },
                {
                   name:'(empty3)',
                   y:2,
                   color:'#3ed662',
                },
                {
                   name:'(empty4)',
                   y:2,
                   color:'#3ed662',
                },
             ]
          }
       ],
       exporting:{
          enabled:true
       },
       plotOptions:{
          pie:{
             cursor:'pointer',
             size:'95%',
             dataLabels:{
                enabled:false
             },
             showInLegend:true,
             tooltip:{
                pointFormat:'<b>{point.y}</b>'
             }
          }
       }
    });

Upvotes: 0

Views: 501

Answers (1)

Ivan Chau
Ivan Chau

Reputation: 1433

Adjust fontsize by px and use maxHeight accordingly.

legend:{
  itemStyle:{
    fontFamily:'Arial',
    fontSize:'13px'
},
maxHeight:58

DEMO: http://jsfiddle.net/Ly3Zr/

Upvotes: 3

Related Questions