最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Google Pie Chart not Showing All Data Rows - Stack Overflow

programmeradmin9浏览0评论

I'm trying to plot population vs. country name and I found that the Google Visualization library is rendering only the first few (actually number is seemingly random depending on the data I use) and sometime add "Other" entry, but it doesn't actually have the value of the rest of the entries.

Example 1: With all countries data

Example 2: With some countries filtered out

Is there an actual limit on number of rows? Why is it inconsistent? Is there a way to get around it. I know it's difficult to view if I plot population of all countries on a pie chart, but I should at least be able to do it.

My issue that I can't get a hold of the source code so I can't really see what is going on. Anyone has any idea? Worst case, I will have to sort all data and show the ones with highest number of population first, but i really want to avoid doing that.

I'm trying to plot population vs. country name and I found that the Google Visualization library is rendering only the first few (actually number is seemingly random depending on the data I use) and sometime add "Other" entry, but it doesn't actually have the value of the rest of the entries.

Example 1: With all countries data

Example 2: With some countries filtered out

Is there an actual limit on number of rows? Why is it inconsistent? Is there a way to get around it. I know it's difficult to view if I plot population of all countries on a pie chart, but I should at least be able to do it.

My issue that I can't get a hold of the source code so I can't really see what is going on. Anyone has any idea? Worst case, I will have to sort all data and show the ones with highest number of population first, but i really want to avoid doing that.

Share Improve this question asked Sep 14, 2012 at 1:29 juminozjuminoz 3,2187 gold badges37 silver badges57 bronze badges 1
  • could we see a sample of the data being used? – cchana Commented Sep 14, 2012 at 12:35
Add a ment  | 

2 Answers 2

Reset to default 6

There's an option for sliceVisibilityThreshold, which would probably solve your problem. It's set to 1/720 by default, which is .5%

I tried opening it up to 1/10000 and it did not solve my problem. It puts the tiny slices on the legend, but it's still not using them to calculate the percentage. That's a real problem because the % is also in the data table (that I'm displaying) where it is correct.

-Nicole

You can set the sliceVisibilityThreshold: equal to 0 to disable it. You should pass it through a options var. 0.00001 > 0

 var options = {
    title: 'Popularity of Types of Pizza',
    sliceVisibilityThreshold: 0
  };

  var chart = new 
  google.visualization.PieChart(document.getElementById('chart_div'));
  chart.draw(data, options);
发布评论

评论列表(0)

  1. 暂无评论