org.geotools.renderer.chart
Class ChartGraphicFactory
java.lang.Object
org.geotools.renderer.chart.ChartGraphicFactory
- All Implemented Interfaces:
- ExternalGraphicFactory
public class ChartGraphicFactory
- extends java.lang.Object
- implements ExternalGraphicFactory
Parses Google charts like requests into various kinds of charts.
Underlying implementation is based on Eastwood charts
and JFreeChart
And example of a valid symbolizer use in SLD is:
<ExternalGraphic>
<OnlineResource xlink:href="http://chart?cht=p&chl=male|female&chd=t:${100 * male / (male + female)},${100 * female / (male + female)}&chs=200x100&chf=bg,s,FFFFFF00"/>
<Format>application/chart</Format>
</ExternalGraphic>
This request will generate a pie chart representing the percentages of female and male
population using attribute features and CQL expression to buid the percentage value to be
used.
For details on the URL format documentation refer to the online
Google charts API.
Also mind Eastwood does not implement all of the Google charts API, for example,
Venn diagram and spider diagrams are not supported. Check on the Eastwood project
pages for details.
- Since:
- 2.5.6
Field Summary |
static java.lang.String |
FORMAT
|
Method Summary |
javax.swing.Icon |
getIcon(org.opengis.feature.Feature feature,
org.opengis.filter.expression.Expression urlExpression,
java.lang.String format,
int size)
Turns the specified URL into an Icon, eventually using the Feature
attributes to evaluate CQL expressions embedded in the url.
The size parameter defines the size of the image (so that
vector based symbols can be drawn at the specified size directly), or may
be zero or negative if the size was not specified (in that case the "natural" size of
the image will be used, which is the size in pixels for raster images, and
16 for any format that does not have a specific size, according to the SLD spec).
null will be returned if this factory cannot handle the
provided url. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FORMAT
public static final java.lang.String FORMAT
- See Also:
- Constant Field Values
ChartGraphicFactory
public ChartGraphicFactory()
getIcon
public javax.swing.Icon getIcon(org.opengis.feature.Feature feature,
org.opengis.filter.expression.Expression urlExpression,
java.lang.String format,
int size)
throws java.lang.Exception
- Description copied from interface:
ExternalGraphicFactory
- Turns the specified URL into an Icon, eventually using the Feature
attributes to evaluate CQL expressions embedded in the url.
The size
parameter defines the size of the image (so that
vector based symbols can be drawn at the specified size directly), or may
be zero or negative if the size was not specified (in that case the "natural" size of
the image will be used, which is the size in pixels for raster images, and
16 for any format that does not have a specific size, according to the SLD spec).
null
will be returned if this factory cannot handle the
provided url.
- Specified by:
getIcon
in interface ExternalGraphicFactory
- Throws:
java.lang.Exception
Copyright © 1996-2010 Geotools. All Rights Reserved.