gchart time vs. log axis example

3 views
Skip to first unread message

rrockwell

unread,
May 16, 2008, 10:14:01 AM5/16/08
to Google Web Toolkit
Just began to use gchart.

On the examples page, I found an x axis time based graph example and a
y axis log based graph example.

I need a x time, y log graph.

I tried to combine the 2 examples but was unsuccessful. A possible
problem is with the current implementation of the log axis. I need to
display a range from 1 to 100,000. I couldn't get anywhere near that
with scaling and ticking.

Any help would be appreciated.

Thanks

John Gunther

unread,
May 21, 2008, 12:33:04 AM5/21/08
to Google Web Toolkit
rrockwell,

The log-axis example chart you are referring to is likely
GChartExample04.java (or a close cousin).

I've added a new example chart, GChartExample04b.java, that adds
parameters (look for, Y_MIN, Y_MAX, and a "relativeTickPositions"
array defined near the top) that make it easier to produce a variety
of log-transformed axis limits and tick spacings.

The modified example isn't in the Chart Gallery, so please get it
directly from the Client-side GChart trunk:

http://gchart.googlecode.com/svn/trunk/gcharttestapp/src/com/googlecode/gchart/gcharttestapp/client/GChartExample04b.java

I appreciate your taking the time to try Client-side GChart and ask
this question...Chances are, many others are struggling with the same
issue.

John C. Gunther
http://gchart.googlecode.com

rrockwell

unread,
May 28, 2008, 1:55:06 PM5/28/08
to Google Web Toolkit
Thanks for the example. I extended the example and now the chart
works.

One strangeness is that although the chart displays, I also get in the
upper left hand corner that symbol that comes up when an image won't
display (I don't know the term).

Any idea to the cause or solution?

Thanks

John Gunther

unread,
May 28, 2008, 11:22:25 PM5/28/08
to Google Web Toolkit
Appreciate your letting me know the example helped.

Regarding the missing image icon, you may have to use GChart's
setBlankImageURL method to resolve it. Please see that method's
javadoc for details:

http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.html#setBlankImageURL%40java.lang.String%41

If the missing image icon comes up every single time, no matter what,
the instructions at the above link will likely solve your problem.

If "missing image" comes up intermittently, setBlankImageURL may not
fix it...basically, any web page that contains an image tag (not just
one containing a GChart) could display the missing image icon if, for
some reason, the browser couldn't get the image from the URL (slow
connection, server overloaded, etc.). Standard thing I do when this
happens to me on any page,,,click Refresh.

If GChart used div tags rather than image tags, it would not have this
problem. There are (ease-of-implementation) advantages to using the
image tag that justify its continued use despite this relative
weakness, but if enough people report that this is a major pain for
them I might have to reconsider that decision.

Finally, just in case this helps, I once saw an old IE6 browser at a
publicly accessible "internet kiosk" computer that may have had
something wrong with it that repeatedly downloaded "gchart.gif" every
single time as if it had never seen it before, and that computer
produced the missing image icon intermittently on the GChart live demo
chart. I do not see this on the (free) "Microsoft Virtual PC based"
IE6 (presumably the final IE6 release) I use to test GChart. So it may
be possible for an older browser (perhaps on a virus infected
computer?) to repeatedly download GChart's tiny 1 x1 pixel image
despite any Image.prefetch GWT directive that may have been issued,
causing the problem.

John
Reply all
Reply to author
Forward
0 new messages