public class Graph
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
static int |
FLAGS_FIT
Flag to indicate the chart to fit the extent.
|
static int |
FLAGS_NON_ANTI_ALIASED
Flag to indicate non-anti-aliased drawing
|
Constructor and Description |
---|
Graph(int width,
int height,
java.lang.String type)
Creates a graph chart of the given width, height and type.
|
Modifier and Type | Method and Description |
---|---|
Layer |
createLayer(boolean doDraw,
int width,
int height) |
Layer |
draw(boolean doDraw) |
java.awt.Color |
getBgColor() |
Chart |
getChart() |
Data |
getData() |
java.awt.Rectangle |
getExtent() |
int |
getFlags() |
Grid |
getGrid() |
int |
getMaxcols() |
int |
getMaxrows() |
Metrics |
getMetrics() |
Axis |
getXAxis() |
Axis |
getYAxis() |
void |
initGraphSamples(java.lang.String[][] dataTable,
boolean nocateg,
boolean nolabels) |
void |
initGraphSamples(java.lang.String[] labels,
java.lang.String[] legends,
double[][] samples) |
void |
setBgColor(java.awt.Color bgcolor) |
void |
setFlags(int flags) |
void |
setGrid(Grid grid) |
void |
setMaxcols(int maxcols) |
void |
setMaxrows(int maxrows) |
void |
setXAxis(Axis x) |
void |
setYAxis(Axis y) |
public static final int FLAGS_FIT
public static final int FLAGS_NON_ANTI_ALIASED
public Graph(int width, int height, java.lang.String type)
Chart.getInstance(String)
method. See there for a definition of
this parameter.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 by Chart.getInstance(String)
.public void initGraphSamples(java.lang.String[] labels, java.lang.String[] legends, double[][] samples)
public void initGraphSamples(java.lang.String[][] dataTable, boolean nocateg, boolean nolabels)
public Layer draw(boolean doDraw)
draw(boolean)
public Layer createLayer(boolean doDraw, int width, int height)
createLayer(boolean, int, int)
public void setBgColor(java.awt.Color bgcolor)
setBgColor(java.awt.Color)
public java.awt.Color getBgColor()
getBgColor()
public Chart getChart()
getChart()
public java.awt.Rectangle getExtent()
getExtent()
public void setFlags(int flags)
setFlags(int)
public int getFlags()
getFlags()
public void setGrid(Grid grid)
setGrid(com.day.cq.graphics.chart.Grid)
public void setMaxcols(int maxcols)
setMaxcols(int)
public int getMaxcols()
getMaxcols()
public void setMaxrows(int maxrows)
setMaxrows(int)
public int getMaxrows()
getMaxrows()
public Metrics getMetrics()
getMetrics()
public void setXAxis(Axis x)
setXAxis(com.day.cq.graphics.chart.Axis)
public Axis getXAxis()
getXAxis()
public void setYAxis(Axis y)
setYAxis(com.day.cq.graphics.chart.Axis)
public Axis getYAxis()
getYAxis()
Copyright © 2010 - 2020 Adobe. All Rights Reserved