简体   繁体   中英

Google Charts Pie : How to start two value at 0?

I'm going to try to be as clear as possible :)

I have three values I want to display in a Pie chart :

  • Number of items found
  • Number of items that has been searched
  • Total number to search.

For example, I have 100 items to search (total). On those 100, I already processed 45 of them (searched). And of those 45, I've found 10.

So :

  • 10% has been found
  • 45% has been searched.

Now, on a Pie chart, I'd like to display the following informations :

  • % of found
  • % of searched
  • % of remaining

The issue is that, with Google Pie Chart, If I enter the following datas :

['State', 'Percentage'],
['Found', 10],
['Searched', 45],
['Remaining', (100 - 45)]

This will display a chart with

  • the first item from 0 to 10% of the circle
  • The second item from 10% to 55% of the circle
  • The last item from 45% to 100% of the circle

My issue is with the second item! Since Searched already contains the found, it CANNOT go after the found, but must include them.

But I can't just substract found (10%) from searched (45%) to have the correct visual, because then the tooltip will say 35% of searched (45-10) instead of the true value.

How can I do ?

Change searched to not matched. That way, it is clear that found, and not matched, both fall under the category searched.

To make that clearer. Your pie chart would have three categories. Matched, not matched, remaining to be searched.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM