Couple of more remarks on printing GCharts that may be helpful.

The graphical part of a GChart (unless you are using the optional bolt-
on canvas line curve capability) is simply a bunch of images
absolutely positioned within a box (via AbsolutePanel). So it seems
reasonable that this collection of images should act very similarly to
a single image chart on the page from the point of view of printing.
Thus there is no logical reason you should not be able to print a page
containing a GChart just as easily as you could print a page
containing an image-based chart. In theory.

Now, under normal circumstances, all those images are the same single
1x1 px blank gif. and the background and border and size are
manipulated to produce the rectangles of the chart's parts.

If this use of image backgrounds is a problem during printing, GChart
has methods that allow you to specify a non-blank default image, plus
a different image for each curve. These methods are setBlankImageURL
and setImageURL, respectively. and could be used to effectively
replace the background color with a real image color (assuming the use
of image background colors presented a problem during printing, as it
can in FF2). Here are the javadoc links for these two methods, for
reference:

http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.html#setBlankImageURL%28java.lang.String%29
http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Symbol.html#setImageURL%28java.lang.String%29

For example, the "dropped axis lines during printing" you mentioned
might be corrected by passing a 1x1 px black GIF to setBlankImageURL
and various 1x1px colored images to setImageURL to define each curve's
"inside" color instead of the usual use of setBackgroundColor (I've
not actually tried this, but it should work).

The other part of a GChart is the text. These are placed within single-
celled tables (for alignment purposes) and those tables are absolutely
positioned on the same box. Again, I don't see why this should be
significantly different than printing an image-based chart, either
(the alignment techniques are--over a reasonable range--font-size
independent).

HTML and widget-based annotations and such are the wild-cards, opening
it up to just about anything. But, presumably, if you built the HTML/
Widget and wanted to print it, you'd be responsible for that (the same
table-based aligned positioning used for text is used for HTML/
widgets, so they should stay in appropriate positions on the chart).

Unfortunately, I have zero practical experience building printable web
pages so all this is just educated guess work; if anyone has real
experience with printable pages and is willing to share that
experience to help improve GChart's "printability", I'd appreciate
that.

John

On Jan 7, 12:13 am, John Gunther <[email protected]> wrote:
> In Firefox 2, if you select File, Print Preview, then Page Setup, then
> Format&Options, and make sure that "Print Background (color and
> images)" is checked, I see the live demo page more or less correctly
> in Print Preview with this checked. But lots of stuff is missing
> (including axis lines) if this is unchecked (note: default setting is
> unchecked).
>
> GChartuses backgrounds of blank images for much of what it does,
> which is why you need to check this to get everything to print that
> shows on the screen in Firefox 2.
>
> I don't testGChartfor how well the chart's can be printed in the
> various browsers (I've never had much luck printing out web pages,
> period). In the end it is HTML in the browser, so it should be
> printable to the degree that HTML is, in theory, but it was looking
> pretty ugly in print preview when I tried to print the live demo page
> from IE7 just now. FF2 (with the setting above) seemed to do much
> better.
>
> HTH,
>
> John C. Guntherhttp://gchart.googlecode.com
>
> On Jan 2, 10:57 am, ArunDhaJ <[email protected]> wrote:
>
> > Hi,
> > I'm not able to see the axis lines on printing the chart. In my Bar
> > chart, bars are printing fine, but not able to print lines... Plz help
> > me whether I'm missing any thing..
>
> > Thanks
> > ArunDhaJwww.arundhaj.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to