0
votes

I am using the older version of Google charts API to generate simple images.

for example: https://chart.googleapis.com/chart?chs=250x100&chd=t:265,148&cht=p3&chl=empty%20-%20%20265%20|%20with%20link%20-148

You can find the docs for api here. The part of the link responsible for values of the chart is followed by the "t:" argument in the link.

As you see I am passing 2 values: 265 and 148 but the chart is showing them as nearly equal halves of the chart.....

Any idea why is that? Did anyone have a similar problem?

All the best,

Adam

1

1 Answers

0
votes

The numbers you have supplied are both over 100, meaning that you effectively are trying to display 413%. You can create the correct graph by working out the percentage for each and using that.

In your example, you should have 64% and 36% as the values: https://chart.googleapis.com/chart?chs=250x100&chd=t:64,36&cht=p3&chl=empty%20-%20%20265%20|%20with%20link%20-148

I worked these out with the following equation:

(value / (total)) * 100