tags:

views:

629

answers:

2

Hello

I have recently started looking into Google Charts API for possible use within the product I'm working on. When constructing the URL for a given chart, the data points can be specified in three different formats, unencoded, using simple encoding and using extended encoding (http://code.google.com/apis/chart/formats.html). However, there seems to be no way around the fact that the highest value possible to specify for a data point is using extended encoding and is in that case 4095 (endoded as "..").

Am I missing something here or is this limit for real?

Thanks

+4  A: 

When using the Google Chart API, you will usually need to scale your data yourself so that it fits within the 0-4095 range required by the API.

For example, if you have data values from 0 to 1,000,000 then you could divide all your data by 245 so that it fits within the available range (1000000 / 245 = 4081).

Greg Hewgill
+1  A: 

Per data scaling, this may also help you:

http://code.google.com/apis/chart/formats.html#data_scaling

Note the chds parameter option.

You may also wish to consider leveraging a wrapper API that abstracts away some of these ugly details. They are listed here:

http://groups.google.com/group/google-chart-api/web/useful-links-to-api-libraries

I wrote charts4j which has functionality to help you deal with data scaling.

Julien Chastang