hAxis title problem

30 views
Skip to first unread message

Yousef El-Khalili

unread,
May 19, 2016, 10:44:16 AM5/19/16
to Google Visualization API
I'm generating a google column chart and I have this as my options array (taken from the page source after the chart is generated)

options: {"title":"Overall Stats","height":350,"vAxis":{"title":"Stats"},"hAxis":{"title":"Division"}},

However, this sets "Division" to both the horizontal and vertical axes for some reason.

Does anyone know why?

Yousef El-Khalili

unread,
May 19, 2016, 10:55:03 AM5/19/16
to Google Visualization API
This is the code I'm using to set the titles: 


if ($chart->getId() === 'Stats_2016') {

   $chart->setOptions(array(

      'vAxis' => array('title' => "Stats"),                      
      'hAxis' => array('title' => "Division"),

   ));

}


Daniel LaLiberte

unread,
May 19, 2016, 1:34:09 PM5/19/16
to Google Visualization API
I suspect you are not actually getting the options structure in the browser that you believe you are based on your server side code.  Can you point us to a web page that shows the chart you are drawing?  

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba870895-5dba-4763-bc9c-d3229b941606%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Yousef El-Khalili

unread,
May 19, 2016, 1:47:26 PM5/19/16
to Google Visualization API

Can you please elaborate on what you mean. I'm using a PHP generator to generate these webpages based on a database so I don't have access to JS code to modify it. I have to use PHP using a mehtod called OnPrepareChart($chart) to insert these options, most of the options work except setting titles to the axes. Here's a picture of the chart. 

No matter what I do, it displays it on both axes. It seems that hAxis has precedence over the vAxis in the sense that if I only specify a vAxis title, it will display that on both axes but if I specify both, it will pick the hAxis to display. 

Thank you for your reply 

On Thursday, May 19, 2016 at 1:34:09 PM UTC-4, Daniel LaLiberte wrote:
I suspect you are not actually getting the options structure in the browser that you believe you are based on your server side code.  Can you point us to a web page that shows the chart you are drawing?  
On Thu, May 19, 2016 at 10:55 AM, Yousef El-Khalili <yousef.el...@gmail.com> wrote:
This is the code I'm using to set the titles: 


if ($chart->getId() === 'Stats_2016') {

   $chart->setOptions(array(

      'vAxis' => array('title' => "Stats"),                      
      'hAxis' => array('title' => "Division"),

   ));

}



On Thursday, May 19, 2016 at 10:44:16 AM UTC-4, Yousef El-Khalili wrote:
I'm generating a google column chart and I have this as my options array (taken from the page source after the chart is generated)

options: {"title":"Overall Stats","height":350,"vAxis":{"title":"Stats"},"hAxis":{"title":"Division"}},

However, this sets "Division" to both the horizontal and vertical axes for some reason.

Does anyone know why?

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

Daniel LaLiberte

unread,
May 19, 2016, 2:18:12 PM5/19/16
to Google Visualization API
Go to your browser and open up the JavaScript debugger.  Find the HTML and JS code that is generated by your php code.

On Thu, May 19, 2016 at 1:47 PM, Yousef El-Khalili <yousef.el...@gmail.com> wrote:

Can you please elaborate on what you mean. I'm using a PHP generator to generate these webpages based on a database so I don't have access to JS code to modify it. I have to use PHP using a mehtod called OnPrepareChart($chart) to insert these options, most of the options work except setting titles to the axes. Here's a picture of the chart. 

No matter what I do, it displays it on both axes. It seems that hAxis has precedence over the vAxis in the sense that if I only specify a vAxis title, it will display that on both axes but if I specify both, it will pick the hAxis to display. 

Thank you for your reply 

On Thursday, May 19, 2016 at 1:34:09 PM UTC-4, Daniel LaLiberte wrote:
I suspect you are not actually getting the options structure in the browser that you believe you are based on your server side code.  Can you point us to a web page that shows the chart you are drawing?  
On Thu, May 19, 2016 at 10:55 AM, Yousef El-Khalili <yousef.el...@gmail.com> wrote:
This is the code I'm using to set the titles: 


if ($chart->getId() === 'Stats_2016') {

   $chart->setOptions(array(

      'vAxis' => array('title' => "Stats"),                      
      'hAxis' => array('title' => "Division"),

   ));

}



On Thursday, May 19, 2016 at 10:44:16 AM UTC-4, Yousef El-Khalili wrote:
I'm generating a google column chart and I have this as my options array (taken from the page source after the chart is generated)

options: {"title":"Overall Stats","height":350,"vAxis":{"title":"Stats"},"hAxis":{"title":"Division"}},

However, this sets "Division" to both the horizontal and vertical axes for some reason.

Does anyone know why?

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.



--

lizeth sanchez

unread,
May 25, 2016, 8:54:28 AM5/25/16
to Google Visualization API


Estimados tengo un problema con la configuración de haxis en un gráfico de combochart, me muestra el texto entrecortado, quiero saber si hay la manera de ponerle un tamaño fijo o mostrarlo en varias lineas. Gracias


grafico.jpg
Reply all
Reply to author
Forward
0 new messages