Possible bug in the API

74 views
Skip to first unread message

danijels

unread,
Aug 19, 2009, 6:31:15 AM8/19/09
to Google Chart API
I'll just give an example from the API documentation

http://chart.apis.google.com/chart?cht=v&chs=200x100&chd=t:100,20,20,20,20,0,0&chdl=First|Second|Third&chco=ff0000,00ff00,0000ff&chdlp=t

Here, chdl parameter has value "First|Second|Third", yet the chart
shows those in a different order (First, Third, Second). I can't seem
to find any way to determine the order in which they will appear and I
also suspect they should appear in the order specified in the
parameter value.

I have the exact same problem in my own usage of the API and can't
figure out what to do to solve it.

Thanks

danijels

unread,
Sep 4, 2009, 4:15:21 AM9/4/09
to Google Chart API
Is there noe one to give a clue on this?

On Aug 19, 12:31 pm, danijels <danij...@gmail.com> wrote:
> I'll just give an example from the API documentation
>
> http://chart.apis.google.com/chart?cht=v&chs=200x100&chd=t:100,20,20,...Second|Third&chco=ff0000,00ff00,0000ff&chdlp=t

KeithB

unread,
Sep 4, 2009, 9:56:49 AM9/4/09
to Google Chart API
I agree, it's a bug and I can't find any good workaround except to
have you change the length of your legend text. It appears that the
API is rearranging the order of the legend items in order to place the
longest item on the right -- I guess so that if any clipping occurs it
will clip overly long legend item text.

You can try forcing the order by rewording your legend items. I've
also tried adding spacing (+ and %C2%A0), but they are being ignored.
Other workarounds would be to move the legend to the right/left or
into HTML.

Good luck,
K

Tom Maslen

unread,
Sep 4, 2009, 11:35:33 AM9/4/09
to google-c...@googlegroups.com
I had an issue where the order of the items in the legend were reversed
depending on whether a bar chart was vertical or horizontal. I was told
this was by design.

Was looking for the google groups message earlier but can't find it.

/Tom
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.

Tom Maslen

unread,
Sep 4, 2009, 11:41:36 AM9/4/09
to google-c...@googlegroups.com

KeithB

unread,
Sep 4, 2009, 11:53:15 AM9/4/09
to Google Chart API
Tom - I believe the issue you're referring to is related to axis
labels, not legend items.

danijels

unread,
Sep 8, 2009, 7:28:16 AM9/8/09
to Google Chart API
To Google people: now is as good time as any to comment on this. Thanks

Bug Chart

unread,
Sep 9, 2009, 8:02:46 AM9/9/09
to google-c...@googlegroups.com
Hi,

you probably want to use:


this is not well documented, and I'm aware of this.
just a short explanation:
when using vertical alignment for the legend,
we reorder them,
but you can override it with chdlp=t|<type>
where <type> is 
r for reverse order, 
a for length,
and l for what is given in the chdl.

hope that helps,

BugChart.

Reply all
Reply to author
Forward
0 new messages