Displaying texts on column charts

131 views
Skip to first unread message

Sabareesh Viswanathan

unread,
Jun 13, 2012, 8:51:03 AM6/13/12
to Google Visualization API
Hi
I have integrated gchart in my application , but i have one
regarding how to display labels on text on the column charts ,
currently when mouse is moved on any of the charts i am getting a
small info window displaying the value,
how to display the same value as a text above the column chart ?

Thank you

asgallant

unread,
Jun 13, 2012, 10:29:46 AM6/13/12
to google-visua...@googlegroups.com
Add an HTML node to your page above the chart's div, and use these event listeners:

google.visualization.events.addListener(chart'onmouseover'function (e{
    if (typeof(e.row!= 'undefined' && e.row != null{
        document.getElementById('txt').innerHTML '<b>' data.getColumnLabel(e.column'</b><br />' data.getValue(e.row0': ' data.getValue(e.rowe.column);
    }
});
google.visualization.events.addListener(chart'onmouseout'function (e{
    document.getElementById('txt').innerHTML '';
}); 

Replace 'txt' with the id of your HTML node.

Sabareesh Viswanathan

unread,
Jun 13, 2012, 10:38:44 AM6/13/12
to google-visua...@googlegroups.com

Thank you. Ill try this .

--
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/-/3yew8mJu9NcJ.
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.

Sabareesh Viswanathan

unread,
Jun 14, 2012, 3:25:57 AM6/14/12
to google-visua...@googlegroups.com
Actually my question is i don't want it on any event listeners . By default the gchart API displays the  value in the info window .
I want to modify that and display the text above the bar along with the chart when it is created . That is similar to the image chart which is deprecated where we use chm.

asgallant

unread,
Jun 14, 2012, 10:20:34 AM6/14/12
to google-visua...@googlegroups.com
Ahh, there is no support for what you want.
Reply all
Reply to author
Forward
0 new messages