Bar Chart Help!?

25 views
Skip to first unread message

shane.s...@presona.co.uk

unread,
Jan 17, 2012, 7:40:01 AM1/17/12
to Google Visualization API
Hi All,

I'm new to the Google Visualization API, so I messed around with the
java and got it working but i now have two questions that I have tried
to answer myself and just can’t figure it out....

1. How do you get the bars to go from 0 to their pre-determined value
when the page or tab loads?
(As a html5 animation not flash)

2. How do you but different text within the labels? Such as 2 x 40 and
the bar shows 80?

If anyone can answer me these questions I would be grateful...

Thanks
Message has been deleted

visigoth

unread,
Jan 19, 2012, 5:39:04 AM1/19/12
to google-visua...@googlegroups.com
Hi,

1.
Please look at the first example in the Transition Animation documentation page.
You need to call draw() twice: first with all bar values set to 0, and then after receiving the 'ready' event with the target values.
You also need to specify the animation configuration option. 

2.
I don't quite understand what you mean by "bar shows 80". Do you mean the value on the axis is 80, or the tooltip value is 80?
The label beside the bar is the name of the corresponding data table row. Look at the addRow() method.
The other labels are configurable using the hAxis.format configuration option.
The tooltip value is configurable using a formatter or the more general tooltip role.

Hope this helps,
Visigoth

    
Reply all
Reply to author
Forward
0 new messages