Package org.faceless.graph2
Class Output
- java.lang.Object
-
- org.faceless.graph2.Output
-
- Direct Known Subclasses:
ImageOutput
,PDFOutput
,SVGOutput
public abstract class Output extends Object
The Output class is the abstract base class for all types of Output in the library. When a graph is complete, it is rendered to an Output using the
Graph.draw(org.faceless.graph2.Output)
method.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Shape>
getAreas()
Return aMap
containing information about the areas used in the graph.void
storeAreas(boolean store)
Whether to store the areas used by each object on the Graph.
-
-
-
Method Detail
-
getAreas
public Map<String,Shape> getAreas()
Return aMap
containing information about the areas used in the graph. This can be used to create rollover or clickable areas on the resulting image. The returned map has a String as a key and anArea
orGeneralPath
as a value. The key determines which object is being described, and is in one of the following formats:graph.series.name
Represents the Area
used by the actual series, where name is one (or more) fields describing the actual data, separated by dots. For instance, if you created a series like this:BarSeries s = new BarSeries("myseries"); s.set("Apples", 20); s.set("Oranges", 20);
Then this Map would include at least the two keysgraph.series.myseries.Apples
andgraph.series.myseries.Oranges
. For stacked bars, you might getgraph.series.myseries.2001.Apples
, and for LineGraphs, where there is no real division of the data, you would simply getgraph.series.myseries
.trace.graph.series.name
This is a GeneralPath
object representing the course actually taken by the data, which may be different the the value returned bygraph.series.name
if, for instance, the graph is drawn with a linethickness > 1 or is rotated in 3D.graph.marker.name
Represents the Area
used by aMarker
on the graph. Here series is the series the marker was added to, and name is the name of the marker. If no name was specified for the marker (the default) then no entry will be added to the Map.key.frame
Represents the Area
used by the Key box.- Returns:
- the Map described above, or
null
ifstoreAreas
(true) wasn't called before drawing.
-
storeAreas
public void storeAreas(boolean store)
Whether to store the areas used by each object on the Graph. This is useful for creating clickable areas in the graph, but it adds a small amount of time to the rendering process so it's not turned on by default. See thegetAreas()
method for more information.- Parameters:
store
- whether to store information required by thegetAreas()
method.- See Also:
getAreas()
-
-