Bold font style to Pie slice text

4,398 views
Skip to first unread message

Dave M

unread,
May 14, 2012, 4:52:40 PM5/14/12
to Google Visualization API
Hello,

Is there a way to make the font bold on a pie char slice?

I tried looking thru the DOM, but the Pie Chart uses an iframe and I
can't reach the text to style it.

Thanks!
Dave

asgallant

unread,
May 14, 2012, 5:44:02 PM5/14/12
to google-visua...@googlegroups.com
Try via the pieSliceTextStyle option.  I'm not sure if it will work, but it's worth a shot.

ChartMan

unread,
May 15, 2012, 2:16:29 AM5/15/12
to google-visua...@googlegroups.com

You can read all the configuration options here:
https://developers.google.com/chart/interactive/docs/gallery/piechart#Configuration_Options

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
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.

Dave M

unread,
May 15, 2012, 8:26:29 AM5/15/12
to Google Visualization API
Thanks all, but the pieSliceTextStyle does not support changing the
text weight to bold, or italics. I've tried different variations of
the configuration options.

Anyone have an example?

On May 15, 2:16 am, ChartMan <chart...@google.com> wrote:
> You can read all the configuration options here:https://developers.google.com/chart/interactive/docs/gallery/piechart...

ChartMan

unread,
May 15, 2012, 9:11:47 AM5/15/12
to google-visua...@googlegroups.com

asgallant

unread,
May 15, 2012, 9:20:28 AM5/15/12
to google-visua...@googlegroups.com
That option would be the one to use, if it is possible at all.  There are a few other things you can try, if you're willing to get your hands dirty.

1) Set the forceIframe option to false.  This will cause the charts to render directly in your page rather than in an iframe.  You can then try to use CSS to affect the tooltip, which may or may not affect the chart code (charts are generated with SVG/VML not HTML).
2) You can dig into the contents of the iframe an manipulate elements directly (this method would work with #1 too).  Here's a snippet I wrote a while back for messing with the tooltips: https://groups.google.com/d/msg/google-visualization-api/22N0T30LY3k/D9sSQXbFuTQJ

Note that when you manipulate the chart directly, you will need two code paths: 1 for handling SVG in most browsers, and 1 for handling VML in IE (8-, IIRC 9 uses SVG).  The internal structure of the charts is also subject to change between API versions, so the code could break at any time.

Using a DOM inspector (see Chrome/FF dev tools) will help immensely in determining what you need to modify.


On Tuesday, May 15, 2012 8:26:29 AM UTC-4, Dave M wrote:
Thanks all, but the pieSliceTextStyle does not support changing the
text weight to bold, or italics.  I've tried different variations of
the configuration options.

Anyone have an example?

On May 15, 2:16 am, ChartMan <chart...@google.com> wrote:
> You can read all the configuration options here:https://developers.google.com/chart/interactive/docs/gallery/piechart...
> On May 15, 2012 12:28 AM, "Dave M" <windydavemeu...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > Is there a way to make the font bold on a pie char slice?
>
> > I tried looking thru the DOM, but the Pie Chart uses an iframe and I
> > can't reach the text to style it.
>
> > Thanks!
> > Dave
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Visualization API" group.
> > To post to this group, send email to
> > To unsubscribe from this group, send email to

Dave M

unread,
May 15, 2012, 4:27:41 PM5/15/12
to Google Visualization API
Thank you, ChartMan!

bold: true in the piceSliceTextStyle worked! Wish they would document
that :-)

On May 15, 9:11 am, ChartMan <chart...@google.com> wrote:
> Look here:http://savedbythegoog.appspot.com/?id=1ad72ee49d6fae76dee7ae38ebb4d09...

Dave M

unread,
May 16, 2012, 2:06:43 PM5/16/12
to Google Visualization API
Thanks for the forceIFrame tip, asgallant!!

On May 15, 9:20 am, asgallant <drew_gall...@abtassoc.com> wrote:
> That option would be the one to use, if it is possible at all.  There are a
> few other things you can try, if you're willing to get your hands dirty.
>
> 1) Set the forceIframe option to false.  This will cause the charts to
> render directly in your page rather than in an iframe.  You can then try to
> use CSS to affect the tooltip, which may or may not affect the chart code
> (charts are generated with SVG/VML not HTML).
> 2) You can dig into the contents of the iframe an manipulate elements
> directly (this method would work with #1 too).  Here's a snippet I wrote a
> while back for messing with the tooltips:https://groups.google.com/d/msg/google-visualization-api/22N0T30LY3k/...
> > > > google-visua...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-visualizati...@googlegroups.com.

Felipe Vásquez

unread,
Dec 27, 2013, 11:33:06 AM12/27/13
to google-visua...@googlegroups.com
A little old topic, but here's what works:

pieSliceTextStyle: {bold: true}

Cheers.

--fv
Reply all
Reply to author
Forward
0 new messages