How many values can Google Chart (line chart) support?

89 views
Skip to first unread message

@ticus

unread,
Mar 12, 2008, 6:09:41 PM3/12/08
to Google Chart API
I'm not kidding :D this is my URL, (I'm trying to use google chart for
processing daily temperatures of weather station. How many values can
Google Chart (line chart) support?

<img src="http://chart.apis.google.com/chart?
chs=800x500
&amp;chd=t:
73.6,0.0,72.6,72.55,72.5,72.5,72.45,72.45,72.5,72.6,72.6,72.7,72.7,72.7,72.7,72.7,72.65,72.6,72.5,72.4,72.4,72.3,7

2.25,72.2,72.1,72.1,72.1,72.0,72.0,72.0,71.9,71.9,71.8,71.7,71.65,71.6,71.5,71.45,71.4,71.3,71.3,71.3,71.3,71.25,71.2,71.2,71

.
1,71.1,71.0,71.0,70.95,70.9,70.9,70.85,70.85,70.8,70.8,70.8,70.8,70.8,70.8,70.8,70.8,70.8,70.8,70.85,70.9,70.9,70.9,70.9,70.

95,70.9,70.9,70.9,70.85,70.8,70.8,70.8,70.7,70.7,70.6,70.6,70.6,70.7,70.7,70.7,70.7,70.7,70.7,70.6,70.55,70.5,70.5,70.4,70.4,

70.4,70.3,70.3,70.3,70.2,70.2,70.2,70.15,70.1,70.1,70.0,69.9,69.85,69.8,69.8,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.75,69.8,69

.
8,69.8,69.8,69.8,69.8,69.8,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.7,69.6,69.6,69.7,69.75,6

9.85,69.9,69.95,70.05,70.1,70.15,70.2,70.3,70.35,70.4,70.4,70.4,70.3,70.2,70.1,69.95,69.9,69.8,69.75,69.7,69.6,69.5,69.5,69.5

,
69.4,69.35,69.3,69.25,69.3,69.35,69.4,69.4,69.4,69.4,69.35,69.3,69.3,69.3,69.3,69.3,69.3,69.3,69.3,69.3,69.3,69.25,69.2,69.2

,
69.2,69.2,69.2,69.2,69.1,69.1,69.1,69.1,69.1,69.1,69.1,69.1,69.1,69.2,69.2,69.15,69.1,69.1,69.1,69.1,69.1,69.1,69.05,69.0,69

.
0,68.9,68.9,68.85,68.8,68.75,68.65,68.6,68.6,68.6,68.5,68.5,68.5,68.5,68.5,68.5,68.5,68.5,68.5,68.5,68.5,68.6,68.6,68.6,68.7

,
68.8,68.8,68.8,68.8,68.8,68.85,68.9,68.9,68.9,68.9,68.85,68.8,68.8,68.75,68.8,68.8,68.9,68.9,68.95,69.0,68.95,68.95,69.0,68.

95,68.9,68.9,68.9,68.9,68.9,68.9,68.9,68.85,68.9,68.9,69.0,69.1,69.2,69.2,69.3,69.4,69.5,69.5,69.5,69.5,69.5,69.5,69.5,69.5,6

9.5,69.5,69.5,69.55,69.75,69.9,69.95,70.05,70.1,70.25,70.35,70.4,70.5,70.7,70.8,70.85,71.0,71.05,71.15,71.2,71.3,71.3,71.3,71

.
3,71.3,71.25,71.15,71.0,70.9,70.8,70.75,70.7,70.65,70.6,70.6,70.6,70.6,70.55,70.5,70.5,70.45,70.4,70.4,70.4,70.4,70.4,70.4,7

0.4,70.45,70.5,70.5,70.5,70.5,70.5,70.5,70.5,70.5,70.45,70.4,70.4,70.4,70.3,70.3,70.2,70.2,70.1,70.1,70.1,70.1,70.1,70.15,70.

2,70.2,70.25,70.3,70.3,70.3,70.3,70.4,70.5,70.6,70.65,70.75,70.8,70.8,70.8,70.9,70.85,70.8,70.7,70.6,70.5,70.4,70.3,70.2,70.1

,
70.0,69.95,69.9,69.85,69.8,69.7,69.7,69.7,69.7,69.7,69.7,69.6,69.6,69.7,69.65,69.6,69.6,69.5,69.5,69.5,69.4,69.4,69.4,69.4,6

9.45,69.55,69.7,69.7,69.65,69.6,69.5,69.5,69.5,69.4,69.4,69.4,69.4,69.5,69.5,69.5,69.6,69.6,69.6,69.6,69.65,69.7,69.7,69.75,6

9.8,69.9,69.9,70.0,70.0,70.0,70.05,70.1,70.1,70.2,70.2,70.3,70.3,70.35,70.4,70.4,70.5,70.5,70.6,70.6,70.7,70.8,70.8,70.9,71.0

,
71.1,71.2,71.3,71.4,71.55,71.7,71.85,72.0,72.1,72.2,72.25,72.3,72.4,72.45,72.5,72.6,72.65,72.75,72.85,72.95,73.05,73.15,73.3

,
73.4,73.55,73.65,73.8,73.85,73.9,74.0,74.05,74.1,74.2,74.25,74.35,74.45,74.55,74.6,74.7,74.8,74.8,74.85,74.9,74.9,74.9,74.9,

74.9,75.0,75.0,75.1,75.1,75.2,75.3,75.4,75.5,75.55,75.7,75.8,75.9,75.9,75.9,75.9,75.95,76.0,76.15,76.2,76.2,76.2,76.2,76.2,76

.
2,76.3,76.45,76.5,76.6,76.6,76.65,76.7,76.75,76.85,77.0,77.05,77.1,77.2,77.2,77.2,77.15,77.15,77.2,77.3,77.4,77.5,77.5,77.55

,
77.6,77.6,77.6,77.6,77.75,77.9,77.95,77.9,78.0,78.1,78.25,78.4,78.5,78.65,78.7,78.55,78.45,78.4,78.3,78.3,78.3,78.3,78.3,78.

25,78.2,78.1,78.1,78.15,78.1,78.2,78.3,78.4,78.5,78.45,78.4,78.3,78.3,78.4,78.4,78.35,78.4,78.4,78.4,78.4,78.4,78.3,78.3,78.2

,
78.2,78.2,78.2,78.1,78.1,78.1,78.1,78.1,78.15,78.2,78.3,78.35,78.4,78.4,78.4,78.4,78.45,78.5,78.6,78.6,78.6,78.65,78.7,78.7,

78.7,78.8,78.9,78.9,78.95,79.15,79.45,79.5,79.45,79.4,79.3,79.3,79.3,79.2,79.15,79.1,79.0,79.1,79.25,79.4,79.55,79.55,79.6,79

.
5,79.5,79.5,79.5,79.5,79.5,79.55,79.6,79.6,79.6,79.6,79.6,79.65,79.7,79.65,79.6,79.6,79.6,79.6,79.6,79.6,79.6,79.6,79.6,79.7

,
79.7,79.75,79.85,80.0,80.15,80.3,80.4,80.4,80.4,80.3,80.3,80.3,80.3,80.3,80.3,80.3,80.35,80.4,80.35,80.3,80.3,80.35,80.4,80.

4,80.3,80.3,80.3,80.3,80.3,80.25,80.2,80.2,80.2,80.2,80.2,80.15,80.1,80.1,80.2,80.2,80.25,80.3,80.3,80.4,80.4,80.4,80.5,80.6,

80.75,80.9,81.05,81.15,81.25,81.25,81.2,81.2,81.15,81.05,80.9,80.8,80.7,80.6,80.5,80.4,80.35,80.3,80.3,80.35,80.5,80.5,80.4,8

0.3,80.2,80.1,80.0,80.0,79.9,79.9,79.85,79.9,79.95,80.0,80.0,80.1,80.2,80.3,80.3,80.4,80.5,80.4,80.35,80.3,80.2,80.1,80.1,80.

05,80.0,80.0,80.0,79.9,79.8,79.75,79.6,79.45,79.35,79.25,79.1,79.05,78.85,78.7,78.7,78.7,78.7,78.65,78.5,78.45,78.3,78.2,78.1

,
78.1,78.1,78.15,78.2,78.2,78.25,78.3,78.3,78.35,78.4,78.45,78.5,78.6,78.7,78.7,78.75,78.85,78.9,79.0,79.1,79.15,79.2,79.35,7

9.6,79.75,79.95,80.1,80.2,80.2,80.2,80.2,80.3,80.3,80.35,80.4,80.4,80.5,80.55,80.65,80.85,81.05,81.2,81.25,81.4,81.5,81.5,81.

4,81.3,81.2,81.2,81.2,81.3,81.35,81.3,81.2,81.25,81.3,81.3,81.3,81.3,81.2,81.1,81.1,81.1,81.2,81.25,81.35,81.45,81.5,81.4,81.

4,81.35,81.3,81.2,81.0,80.85,80.65,80.5,80.4,80.3,80.35,80.45,80.55,80.75,80.85,80.95,81.0,81.0,80.9,80.85,80.75,80.7,80.7,80

.
6,80.6,80.5,80.5,80.5,80.4,80.4,80.25,80.15,80.0,80.0,80.0,80.05,80.1,80.1,80.15,80.2,80.2,80.3,80.25,79.85,79.1999999999999

9,78.6,78.25,77.95,77.8,77.8,77.8,77.8,77.9,78.05,78.25,78.45,78.7,78.85,79.05,79.25,79.4,79.5,79.6,79.6,79.65,79.8,79.9,79.9

,
79.95,80.0,80.0,80.0,80.0,80.05,80.05,80.0,80.0,79.9,79.85,79.8,79.7,79.7,79.6,79.7,79.7,79.85,79.95,80.15,80.3,80.3,80.2,80

.
1,80.0,80.05,80.1,80.1,80.1,80.1,80.15,80.25,80.3,80.3,80.45,80.5,80.4,80.25,80.05,79.69999999999999,79.19999999999999,78.75

,
78.55,78.15,77.75,77.55,77.25,77.2,77.3,77.3,77.45,77.65,77.9,78.05,78.2,78.3,78.4,78.45,78.5,78.5,78.5,78.5,78.5,78.35,78.2

5,78.15,78.0,77.9,77.85,77.8,77.8,77.8,77.7,77.7,77.75,77.8,77.8,77.8,77.8,77.8,77.8,77.85,77.95,78.0,78.1,78.25,78.35,78.55,

78.7,78.7,78.7,78.8,78.8,78.8,78.8,78.8,78.9,78.9,78.85,78.7,78.45,78.2,78.05,77.95,77.9,77.75,77.55,77.45,77.3,77.2,77.1,77.

0,76.9,76.9,76.85,76.8,76.8,76.7,76.7,76.7,76.6,76.6,76.6,76.6,76.65,76.7,76.7,76.7,76.7,76.8,76.8,76.8,76.8,76.8,76.8,76.85,

76.9,76.9,76.9,76.9,76.9,76.9,76.9,76.9,76.9,76.9,77.0,77.0,77.0,77.0,77.0,77.0,77.0,76.80000000000001,76.45,76.05,75.65,75.4

,
75.05,74.85,74.65,74.45,74.3,74.2,74.1,74.0,74.0,73.9,73.9,73.85,73.8,73.8,73.8,73.7,73.7,73.7,73.7,73.7,73.7,73.7,73.7,73.7

,
73.7,73.7,73.7,73.7,73.7,73.7,73.7,73.75,73.7,73.7,73.7,73.7,73.7,73.7,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.

85,73.85,73.85,73.9,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.75,73.7,73.7,73.75,73.8,73.85,73.9,73.9,73.9,73.9,73

.
9,73.9,73.9,73.9,73.85,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.8,73.75,73.7,73.7,73.7,73.7,73.7,73.7,73.65,73.6,73.55,73.5,73.

45,73.4,73.4,73.35,73.3,73.3,73.3,73.3,73.3,73.3,73.25,73.2,73.2,73.2,73.2,73.2,73.2,73.2,73.2,73.2,73.2,73.2,73.2,73.2,73.2,

73.2,73.2,73.2,73.2,73.25,73.3,73.3,73.3,73.3,73.3,73.25,73.3,73.3,73.3,73.3,73.3,73.3,73.3,73.3,73.3,73.3,73.3,73.3,73.3,73.

3,73.3,73.3,73.3,73.3,73.35,73.3,73.3,73.4,73.4,73.4,73.4,73.4,73.4,73.35,73.3,73.3,73.2,73.2,73.15,73.1,73.1,73.1,73.1,73.1,

73.1,73.05,73.0,73.0,72.9,72.9,72.9,72.9,72.8,72.8,72.8,72.8,72.7,72.65,72.6,72.6,72.6,72.5,72.6,72.6,72.55,72.5,72.55,72.5,7

2.5,72.55,72.55,72.5,72.5,72.5,72.5,72.5,72.45,72.4,72.4,72.4,72.4,72.4,72.4,72.4,72.4,72.4,72.4,72.4,72.4,72.5,72.5,72.5,72.

5,72.5,72.5,72.5,72.5,72.5,72.5,72.5,72.5,72.5,72.5,72.5,72.45,72.4,72.4,72.4,72.3,72.3,72.3,72.2,72.2,72.2,72.1,72.1,72.05,7

2.0,71.95,71.9,71.8,71.7,71.7,71.6,71.5,71.5,71.4,71.3,71.3,71.3,71.3,71.2,71.2,71.1,71.1,71.0,71.0,71.0,71.0,71.0,71.0,71.0,

71.0,71.0,71.0,71.0,71.0,71.05,71.1,71.05,71.1,71.1,71.1,71.1,71.1,71.1,71.1,71.1,71.1,71.1,71.1,71.1,71.05,71.05,71.0,71.0,7

1.0,71.0,71.0,71.0,71.0,71.0,71.0,70.9,70.9,70.9,70.9,70.9,70.85,70.85,70.85,70.9,70.9,70.9,70.9,70.9,70.9,70.9,70.9,70.9,71.

0,71.0,71.0,71.0,71.1,71.1,71.15,71.2,71.3,71.3,71.4,71.5,71.6,71.65,71.75,71.85,71.9,72.0,72.1,72.15,72.2,72.2,72.2,72.25,72

.35,72.4,72.4,72.5,72.55,72.6,72.6,72.7,72.7,72.75,72.8,72.8,72.8,72.8
&amp;cht=lc
&amp;chxt=x,y
&amp;chxl=0:|Mar|Apr|May|June|July|August|1:||50+Kb"
alt="Sample chart" />

I've tryed to add almost the same size of labels but the image just
can't be loaded.

Thanks again !!!

Carlos_M

unread,
Mar 14, 2008, 6:07:18 PM3/14/08
to Google Chart API
Hi,

There are constraints for the number of values and the labels that get
rendered on the Chart API - I'm not an specialist nor a Googler, but
the general opinion is that the size of the URL has a limit, and since
the length and precision of the values affect this. you have to work
out the number of values and the decimals that you can support for the
project you are running.

( on top of that, http places a size limit of its own on URL length )

I'd test the URL without labels and with less values until I get it
working - the labels can be added "offline" in the HTML page without
sending them to the Chart API URL, like in the example that I
published a few days back at http://www.carloslabs.com/node/17

CarlosM

Uwe Maurer

unread,
Mar 19, 2008, 7:57:54 PM3/19/08
to Google Chart API
The Google Chart API does not limit the number of datapoints.
However the browsers have a maximal URL length, for example Internet
Explorer has a maximal URL length of 2083 characters.

I suggest to reduce the length of the URL by using a different
encoding for the data.
Currently you use 5 bytes per datapoint: 70.1,
You can reduce this to 3 bytes by removing the last digit (and the
dot), however you loose precision then.
The extended encoding (http://code.google.com/apis/chart/#extended)
only uses 2 bytes per datapoint and has enough precision.

Also you can try to reduce the number of datapoint, eg by only using
every second or third datapoint.

Uwe

Carlos_M

unread,
Mar 20, 2008, 3:42:58 AM3/20/08
to Google Chart API
...so there's no in-built limitation for the URL in the Charts API -

That's something new I didn't know before !

Many thanks for sharing that gem,

CarlosM

Stefan

unread,
Mar 20, 2008, 8:17:31 AM3/20/08
to Google Chart API
Any idea of firefox's max URL length?

Bob Oliver Bigellow XLII

unread,
Mar 20, 2008, 5:37:51 PM3/20/08
to Google Chart API
I am not sure what the limit is in FireFox, but I do know it may be
more than 100,000 characters. So, the FireFox browser itself is
unlikely to be a bottleneck in this scenario.

@ticus

unread,
Mar 20, 2008, 6:52:33 PM3/20/08
to Google Chart API
Thanks!!

I'll try to encode the data. But I wonder why I can't get and image
when I'm using an <img src="http://chart.apis.google.com/chart? etc
etc etc /> tag and not writing the URL on the address bar.

@ticus
.

Bob Oliver Bigellow XLII

unread,
Mar 21, 2008, 12:32:52 AM3/21/08
to Google Chart API
Try an image tag in a file that you think should work, and put this
file up somewhere online. If it doesn't work, post the URL here and
I'll take a look.

Supplanter

unread,
May 18, 2008, 4:44:36 PM5/18/08
to Google Chart API
I realize it's been a few months since this discussion took place, but
I've found that Google *does* impose a maximum length on a URL
for the Charts API -- completely independent of any browser
constraints.

I've found that the maximum length of a URL is 2074 characters, which
breaks down like this:

- 28 characters : "http://chart.apis.google.com"
- 2046 characters : "/chart?..."

That the script_name + query_string does not equal 2048 characters
seems to defy intuition, but there it is all the same.

At 2075 characters, Google replies with a "400 Bad Request" HTTP
response.

Personally, I find this maximum length of 2074 characters to be a
bit short. I've got a form set up at work where a user chooses a
metric to be plotted over a time period of their choosing. If they
choose a time period of something on the order of a year (let's say
500 days) with a single metric, then the length of the generated
URL is less than the maximum, and the user sees a single line
on their line chart just fine, as one would expect.

If, however, they then choose to plot a 2nd metric against the first,
then I need to start removing data points from both sets of data --
a lot of data points -- in order to get the url length in under the
wire. While this technique is necessary -- how else am I going
to get a chart without trimming data points? -- it occurs after I've
already auto-determined the labels for the y-axes, which are also
the values used to define the chart "space", and I've found that all
the local maxima and minima in my chart shrink by the removal
of so many data points. Said another way, while the *shape* of
the lines in my line chart remain the same, the likelihood that the
values change is high, and if the user were comparing the
maximum and minimum values as they appear in the chart
against the labels on the respective y-axes, the user would be
misled.

Overall, I'm very happy with the chart API. Thank you, Google!
Now, is there any way you could be convinced to "up" the value on
the maximum URL length?, maybe to twice as big as its current
maximum length?

Cheers.


On Mar 20, 12:42 am, Carlos_M <carlos.m.m...@gmail.com> wrote:
> ...so there's no in-built limitation for theURLin the Charts API -
>
> That's something new I didn't know before !
>
> Many thanks for sharing that gem,
>
> CarlosM
>
> On Mar 20, 10:57 am, Uwe Maurer <uwe.mau...@google.com> wrote:
>
> > The Google Chart API does not limit the number of datapoints.
> > However the browsers have a maximalURLlength, for example Internet

Robbie

unread,
May 23, 2008, 2:25:31 PM5/23/08
to Google Chart API
I'm running into the Google-imposed length limitation as well. Just 4
data sets with 60 data points each causes a "Bad Request" error. I
love the API, but will have to implement all sorts of hackish
workarounds to avoid getting Bad Requests on moderately sized data
sets.

And while I'm at it, it would be really cool if the Bad Request page
hinted at why the request was "bad".

Looking for any volunteers to work on the API??

Thanks,
Robbie
http://statsheet.com/chart_list


On May 18, 4:44 pm, Supplanter <supplan...@gmail.com> wrote:
> I realize it's been a few months since this discussion took place, but
> I've found that Google *does* impose amaximumlength on a URL
> for the Charts API -- completely independent of any browser
> constraints.
>
> I've found that themaximumlength of a URL is 2074 characters, which
Reply all
Reply to author
Forward
0 new messages