2013-12-11 32 views
0

如何定制使最小的馅饼可见?在HighCharts中看不到最小的馅饼

YouTube不能被看作是你可以从这里看到:http://d.pr/i/nxeP

这里是我的代码(我的提取程序是在Rails):

$(function() { 
    //for donut 
    var data_series = <%= raw get_all_identities(@user) %> ; 
    var getColor ={ 
     facebook: "#3d599b", 
     twitter: "#00abee", 
     instagram: "#736c59", 
     soundcloud: "#fa3d00", 
     youtube: "#d43c3b", 
     tumblr: "#3d5a71", 
     vine: "#00b589", 
     foursquare: "#0abadf", 
     linkedin: "#0abadf", 
     vimeo: "#1ab7ea", 
     fivehundredpx: "#000000", 
     wordpress: "#257ba0", 
     rdio: "#028ed4", 
     behance: "#000000", 
     flickr: "#ff0084" 
    }; 
    $('#user_follower_chart').highcharts({ 
     chart: { 
      plotBackgroundColor: null, 
      plotBorderWidth: null, 
      plotShadow: false 
     }, 
     title: { 
      text: '' 
     }, 
     credits: { 
      enabled: false 
     }, 
     tooltip: { 
      pointFormat: '<b>{point.percentage:.2f}%</b>' 
     }, 
     plotOptions: { 
      pie: { 
       dataLabels: { 
        enabled: false, 
        color: '#000000', 
        connectorColor: '#000000', 
        format: '<b>{point.name}</b>: {point.percentage:.2f} %' 
       }, 
       startAngle: -90, 
       endAngle: 0 
      } 
     }, 
     series: [{ 
      type: 'pie', 
      name: 'Followers By Network', 
      allowPointSelect: true, 
      innerSize: '50%', 
      data: [] 
     }] 
    }); 
    var follower_chart, n, i, len; 

    for (i = 0, len = data_series.length; i < len; i++) { 
     n = data_series[i]; 
     if (n[1] !== 0) { 
      follower_chart = $("#user_follower_chart").highcharts(); 
      follower_chart.series[0].addPoint({ 
       name: n[0], 
       y: n[1], 
       color: getColor[n[2]] 
      }); 
     } 
    } 
+0

你说的最小的馅饼呢?我只能看到一个饼图。 –

+0

他意味着最小的切片 – jlbriggs

+0

如果您拿出实际的输出代码并将其拨出,那么找到解决方案会更容易。 – jlbriggs

回答

0

红片是可见的,并出现适当缩放。

我不知道你希望看到在0.2%的切片什么...

两件事情,我建议:

1)设置边框宽度0,和片将脱颖而出更清楚一点。

2)这实际上应该是一个条形图......无论如何,如果您将其设置为条形图,则可以设置minPointLength属性,以便小数据点仍然显而易见。

example:http://jsfiddle.net/jlbriggs/4FxYg/