Pieslice label is not visible in google pie chart if its proportion is small, can I make it visible?

帅比萌擦擦* 提交于 2019-12-24 16:17:56

问题


This is my code snippet... there is three pie slices in pie chart, but only two labels are visible

  var options = {
      is3D: true,
      fontSize: 7, 
      backgroundColor: 'transparent', 
      legend: 'none', 
      pieSliceText: 'value',
      pieSliceTextStyle: { bold: true, color:'black'}, 
      tooltip: {
          textStyle: { fontSize:  12 }
      },
      slices: {
          0: {color: '#e76442'}, 
          1:{color: '#ffc100'}, 
          2:{color: '#348be7'},
      } 
  };

回答1:


Because there is no data shown my assumption is that the 3rd value is too small so there is no place for it. It is not rendered at all.

One option is to rotate pie chart so missing value get more width to be displayed. For example adding option:

pieStartAngle: 90

See also example Rotating a Pie Chart from google docs. On the left chart word 'Italian' is not visible. On the right chart it is visible after rotation.

Otherwise I don't see option to get it visible.



来源:https://stackoverflow.com/questions/21929851/pieslice-label-is-not-visible-in-google-pie-chart-if-its-proportion-is-small-ca

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!