public class ChartGraphicFactory extends Object implements ExternalGraphicFactory
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.
Constructor and Description |
---|
ChartGraphicFactory() |
Modifier and Type | Method and Description |
---|---|
Icon |
getIcon(Feature feature,
Expression urlExpression,
String format,
int size)
Turns the specified URL into an Icon, eventually using the Feature attributes to evaluate CQL
expressions embedded in the url.
|
public static final String FORMAT
public Icon getIcon(Feature feature, Expression urlExpression, String format, int size) throws Exception
ExternalGraphicFactory
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.getIcon
in interface ExternalGraphicFactory
Exception
Copyright © 1996–2023 Geotools. All rights reserved.