Y-axis Label Overlapping with the column Data

76 views
Skip to first unread message

Pooja Sohni

unread,
Nov 6, 2009, 7:23:56 AM11/6/09
to google-visua...@googlegroups.com
Hi, I am new to gviz and trying to make a bar chart. I have used titleY and titleX to define the XAxis and Y-axis labels. But somehow, the Y-axis label tends to overlap with my column data. Please see attached screen shot below for further reference.: I have also pasted my code below : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Gviz Graph</title> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1', {packages: ['barchart']}); </script> <script type="text/javascript"> function drawVisualization() { var formatter = new google.visualization.NumberFormat({groupingSymbol: ',' , fractionDigits : '0'}); var data = new google.visualization.DataTable(); data.addColumn('date', 'EVENT_DATE'); data.addColumn('number', 'DFA_IMPS'); data.addColumn('number', 'DFP_IMPS'); data.addRows(1); var date_val = new Date(2009,11,01); data.setCell(0, 0, date_val); data.setCell(0, 1,30481590492); data.setCell(0, 2,49338888974); formatter.format(data , 1); formatter.format(data , 2); new google.visualization.BarChart(document.getElementById('visualization')). draw(data, {titleX : 'DISCARDED_VOLUME',titleY : 'EVENT_DATE', title : 'Gviz Graph'}); } google.setOnLoadCallback(drawVisualization); </script> </head> <body style="font-family: Arial;border: 0 none;"> <div id="visualization" style="width: 900px; height: 250px;"></div> </body> </html> Kindly let me know how to add some padding in between the label and the column values. I couldnot find any options for the same.



Thanks
Pooja
graph.bmp

Meera Bavadekar

unread,
Nov 6, 2009, 9:58:14 PM11/6/09
to Google Visualization API

Hi Pooja,

Your code did not reproduced the same image.
I tried it in Google Playground.
Not sure how you are getting a red rectangle in the Y-axis
(surrounding Event lable).


-Meera

Pooja Sohni

unread,
Nov 9, 2009, 12:28:22 AM11/9/09
to google-visua...@googlegroups.com
Hi Meera

The red rectangle, is drawn by me to highlight the problem i am facing
The problem is that, the Y-axis Label and my dates are coming very close to each other.
They are kind of overlapping. I wanted to know if there is some way i can increase the space in between both of them ? . Having some padding.

Regards
Pooja
--
"Impossible itself says - I'm Possible"
Regards
Pooja Sohnie
Reply all
Reply to author
Forward
0 new messages