Reputation: 3077
Please check the following chart and why the size of 10.52% and 2.72 are the same?
Upvotes: 1
Views: 1088
Reputation: 73246
You were just missing the chds=a
parameter, which specifies "automatic scaling" of the values. Add that and the chart will be correct when the data are not percentages.
See: https://developers.google.com/chart/image/docs/data_formats#textformatautoscaling
Here is your example chart with the added parameter.
Unfortunately you'll get seemingly-accurate results without this parameter a lot of the time, so it's easy to miss it. It appears to me that it's basically a requirement for pie charts, though, so I can't imagine why it isn't the default behaviour.
Providing exact percentage values might also work correctly in all situations. I don't actually know the details of the problem, only that automatic scaling solves it when it occurs, so I'm inclined to suggest using it just in case.
Upvotes: 1
Reputation: 3077
chd=t: values are percentage. I thought they were values and google chart will work out the percentage for them.
It has been fixed as soon as I replaced actual values with percentage values. The chart is fixed.
Upvotes: 0