Niall,
To the best of my knowledge, there is no simple way to eliminate that
space completely.
You can reduce such space is via these lines:
getXAxis().setAxisVisible(false);
getXAxis().setTickCount(0);
getXAxis().setTickLength(0);
getXAxis().setTickLabelThickness(0);
getYAxis().setAxisVisible(false);
getYAxis().setTickCount(0);
getYAxis().setTickLabelThickness(0);
getYAxis().setTickLength(0);
To reduce the space even more, you can get tricky by adding the GChart
to an AbsolutePanel, and by manipulating both the upper left corner
position of the GChart (via setWidgetPosition) and the size of the
AbsolutePanel (its size would be 100x20 for your example chart) you
can effectively clip off the extra space (GWT's own Image.java uses an
analogous method for it's image clipping feature).
Problem is that you don't know the amount of this space (you need to
know the space above, and to the left of the real plot). You could use
trial and error, but I'm not even sure if this space is consistent
across different browsers.
GChart uses a DockPanel for the title and footnotes, and a Grid in the
CENTER panel that holds the axis labels, legend, and the plot area
itself (an AbsolutePanel). The spaces are somehow a result of use of
the DockPanel and the Grid.
To date, I have not been able to elimnate the space without
eliminating the DockPanel, but I was afraid if the spacing changed it
would inconvenience someone who relied on the space being there as is
(I don't understand how the DockPanel does its spacing thing).
I'm not happy with the fact that Client-side GChart provides no easy
way to eliminate this space and will try to correct the problem in a
future release. To remind me to do that, you might want to log your
problem into GChart's issue tracker.
Thanks for the question...it points out an important way the product
could be improved.
John C. Gunther
http://gchart.googlecode.com
On Aug 1, 10:13 am, "Niall Haslam" <
niallhas...@googlemail.com> wrote:
> Hi all,
>
> I am using GChart to display some graphical information. I want to create
> something like the sparklines that is available from the google chart api.
> Therefore I want to create a simple widget where the first pixel of the
> widget is the first data point. However, in GChart there seem is always
> space at the left and bottom of the widget for where the X axis and Y axis
> labels and titles should go. Does anyone know how to make them disappear and
> therefore make a graph that looks like this:
>
>
http://chart.apis.google.com/chart?chs=100x20&cht=ls&chco=0077CC&chm=...