Bar Chart : Y-axis alignment

3,348 views
Skip to first unread message

ManuRaj Hada

unread,
Nov 1, 2011, 3:14:26 AM11/1/11
to Google Visualization API, tarun....@metacube.com
Hello,

I am creating a bar chart using google chart api. Over that, chart
have y-axis (vertical axis) default alignment as right justified. I
want to change it to Left justified.

Kindly let me know with the solution. Many Thanks in advance.

-Manu

asgallant

unread,
Nov 1, 2011, 9:34:18 AM11/1/11
to google-visua...@googlegroups.com, tarun....@metacube.com
Bar charts have the y-axis on the left by default: http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html

If you want the bars to change direction, use the hAxis.direction option (default is 1, use -1 to go right-to-left).

Manu Raj Hada

unread,
Nov 1, 2011, 10:22:16 AM11/1/11
to asgallant, google-visua...@googlegroups.com, tarun....@metacube.com
Hi Drew,

Many thanks for reply, I want to change alignment of y-axis (vertical axis) Text not the bar chart.
I am attaching an image, hope this will help.

Thanks Again,
Manu


On 11/1/2011 7:04 PM, asgallant wrote:
Bar charts have the y-axis on the left by default: http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html

If you want the bars to change direction, use the hAxis.direction option (default is 1, use -1 to go right-to-left).
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/4waF5dIe6DYJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

verticalAxisTextAlignment.jpg

asgallant

unread,
Nov 1, 2011, 11:32:26 AM11/1/11
to google-visua...@googlegroups.com, asgallant, tarun....@metacube.com
Ahh...that is not supported, to the best of my knowledge.  I have a hack that end-routes the problem, but it may not be reliable: http://jsfiddle.net/fCNnt/1/

Esger Jellema

unread,
Aug 16, 2013, 10:02:34 AM8/16/13
to google-visua...@googlegroups.com, asgallant, tarun....@metacube.com
Thanks, your hack works fine for me!

Op dinsdag 1 november 2011 16:32:26 UTC+1 schreef asgallant:

asgallant

unread,
Aug 16, 2013, 10:48:19 AM8/16/13
to google-visua...@googlegroups.com, asgallant, tarun....@metacube.com
That hack is way out of date and no longer works in modern browsers; it should only work in IE 8 now.  This is an updated version that should work in modern browsers as well: http://jsfiddle.net/asgallant/fCNnt/8/
Reply all
Reply to author
Forward
0 new messages