Package com.day.cq.graphics
Class Graph
java.lang.Object
com.day.cq.graphics.Graph
The
Graph
class implements the basic functionality for the
chart host object. This class is based on the former rgba/rgba_graph.c
code.
The Graph
object is the top level container of a chart graphic.
It contains all the elements such as the axis, the data and the chart itself.
This object is not truly unmutable, but it is mostly write-once. That is, as soon as a property has been defined through its setter method, it cannot be changed again. It is completely in the responsability of the client not to tamper with any values after having calculated the graph. Moreover it is the clients duty to ensure complete setting of the graph and its component prior to drawing the chart. The results may not be as desired if failing to do so.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Flag to indicate the chart to fit the extent.static final int
Flag to indicate non-anti-aliased drawing -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateLayer
(boolean doDraw, int width, int height) draw
(boolean doDraw) getChart()
getData()
int
getFlags()
getGrid()
int
int
getXAxis()
getYAxis()
void
initGraphSamples
(String[][] dataTable, boolean nocateg, boolean nolabels) void
initGraphSamples
(String[] labels, String[] legends, double[][] samples) void
setBgColor
(Color bgcolor) void
setFlags
(int flags) void
void
setMaxcols
(int maxcols) void
setMaxrows
(int maxrows) void
void
-
Field Details
-
FLAGS_FIT
public static final int FLAGS_FITFlag to indicate the chart to fit the extent.- See Also:
-
FLAGS_NON_ANTI_ALIASED
public static final int FLAGS_NON_ANTI_ALIASEDFlag to indicate non-anti-aliased drawing- See Also:
-
-
Constructor Details
-
Graph
Creates a graph chart of the given width, height and type. The type parameter is used to create the chart object and depends on theChart.getInstance(String)
method. See there for a definition of this parameter.- Parameters:
width
- The desired overall width of the graph chartheight
- The desired overall height of the graph charttype
- The type of chart to draw. The value of this parameter is defined byChart.getInstance(String)
.
-
-
Method Details
-
initGraphSamples
- See Also:
-
initGraphSamples
- See Also:
-
draw
- See Also:
-
createLayer
- See Also:
-
setBgColor
- See Also:
-
getBgColor
- See Also:
-
getChart
- See Also:
-
getData
- See Also:
-
getExtent
- See Also:
-
setFlags
public void setFlags(int flags) - See Also:
-
getFlags
public int getFlags()- See Also:
-
setGrid
- See Also:
-
getGrid
- See Also:
-
setMaxcols
public void setMaxcols(int maxcols) - See Also:
-
getMaxcols
public int getMaxcols()- See Also:
-
setMaxrows
public void setMaxrows(int maxrows) - See Also:
-
getMaxrows
public int getMaxrows()- See Also:
-
getMetrics
- See Also:
-
setXAxis
- See Also:
-
getXAxis
- See Also:
-
setYAxis
- See Also:
-
getYAxis
- See Also:
-