Entering html special characters into chart titles fails

189 views
Skip to first unread message

Jeffrey Greenberg

unread,
Mar 11, 2013, 6:13:45 PM3/11/13
to google-visua...@googlegroups.com
Hi,
I'm working on Google line charts in the coding playground ( https://code.google.com/apis/ajax/playground/?type=visualization#line_chart ).
I'm trying to place special html characters into the chart title like an ampersand using the html encoding: & Instead of displaying an ampersand ( & ), instead it displays the literal string: & .
This seems wrong, and certainly isn't what I want.  In fact, I want to make use of the HTML arrow characters: ↑ and ↓  but these display literally as well rather than displaying as up and down arrows respectively.

This is a bug, right?

asgallant

unread,
Mar 11, 2013, 6:22:39 PM3/11/13
to google-visua...@googlegroups.com
Nope, not a bug.  You need to enter the unicode for the character in javascript.  As an example, use "\u2192" for the right arrow.

Jeffrey Greenberg

unread,
Mar 11, 2013, 6:45:36 PM3/11/13
to google-visua...@googlegroups.com
Thanks!
On a related note, is it possible to style characters within title strings.... like insert a span with class so that a string of characters can be styled with css?

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/c8UgfclVu3U/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

asgallant

unread,
Mar 11, 2013, 7:28:28 PM3/11/13
to google-visua...@googlegroups.com, je...@inventivity.com
No, sorry, the titles aren't HTML compatible.  You can style the title to an extent by using the titleTextStyle option (which has "fontName", "fontSize", and "color" sub options).


On Monday, March 11, 2013 6:45:36 PM UTC-4, Jeffrey Greenberg wrote:
Thanks!
On a related note, is it possible to style characters within title strings.... like insert a span with class so that a string of characters can be styled with css?

On Mon, Mar 11, 2013 at 3:22 PM, asgallant <drew_g...@abtassoc.com> wrote:
Nope, not a bug.  You need to enter the unicode for the character in javascript.  As an example, use "\u2192" for the right arrow.


On Monday, March 11, 2013 6:13:45 PM UTC-4, Jeffrey Greenberg wrote:
Hi,
I'm working on Google line charts in the coding playground ( https://code.google.com/apis/ajax/playground/?type=visualization#line_chart ).
I'm trying to place special html characters into the chart title like an ampersand using the html encoding: &amp; Instead of displaying an ampersand ( & ), instead it displays the literal string: &amp; .
This seems wrong, and certainly isn't what I want.  In fact, I want to make use of the HTML arrow characters: &uarr; and &darr;  but these display literally as well rather than displaying as up and down arrows respectively.

This is a bug, right?

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/c8UgfclVu3U/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages