Chart Builder API (beta)

oracle.ord.media.chart.types
Class GridDesc

java.lang.Object
  |
  +--oracle.ord.media.chart.types.GridDesc

public class GridDesc
extends java.lang.Object

GridDesc objects are used to customize the Grid, and are normally supplied as arguments to setChartAttributes(). Users have control of grid attributes, such as grid color and the line style. The grid can be disabled with setDrawGridOff().

For the time axis, grid lines are drawn based on the labeled time dimension. For example, suppose the time axis is defined at daily intervals, but, because many days are supplied, labels are generated each month. In this case, grid lines will be drawn on monthly boundaries and grid threshold lines will be drawn on yearly boundaries.

The specific heuristic for drawing grid lines along the time axis is the following:

Grid lines are generally drawn for the highest frequency labeled dimension. If this would result in drawing a grid line for every timestamp, grid lines are drawn for the next highest frequency labeled dimension.

By default, grid lines are drawn with a dashed line, while grid threshold lines are drawn with a solid line. The style for grid lines can be changed using setGridStyle(), while the style for grid threshold lines can be changed with setGridStyleThreshold().


Field Summary
static int GRID_LINE_DASHED
          Constant for dashed grid lines.
static int GRID_LINE_DASHED2
          Constant for heavier dashed grid lines.
static int GRID_LINE_SOLID
          Constant for solid grid lines.
 
Constructor Summary
GridDesc()
           
 
Method Summary
 java.awt.Color getColor()
          Get the color of the grid.
 boolean getDrawGrid()
          Get the drawGrid flag.
 int getGridStyle()
          Get the line style of the grid.
 int getGridStyleThreshold()
          Get the line style of the grid threshold.
 void setColor(java.awt.Color color)
          Set the grid color.
 void setDrawGridOff()
          Disable drawing the grid.
 void setGridStyle(int gridStyle)
          Set the style of the grid.
 void setGridStyleThreshold(int gridStyle)
          Set the style of the grid threshold.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRID_LINE_SOLID

public static final int GRID_LINE_SOLID
Constant for solid grid lines.

GRID_LINE_DASHED

public static final int GRID_LINE_DASHED
Constant for dashed grid lines.

GRID_LINE_DASHED2

public static final int GRID_LINE_DASHED2
Constant for heavier dashed grid lines.
Constructor Detail

GridDesc

public GridDesc()
Method Detail

setDrawGridOff

public void setDrawGridOff()
Disable drawing the grid.

setColor

public void setColor(java.awt.Color color)
Set the grid color.
Parameters:
- color Color of the grid.

setGridStyle

public void setGridStyle(int gridStyle)
                  throws ChartException
Set the style of the grid. By default, grid lines are dashed (GRID_LINE_DASHED).
Parameters:
gridStyle - Valid values are GRID_LINE_SOLID, GRID_LINE_DASHED or GRID_LINE_DASHED2.

setGridStyleThreshold

public void setGridStyleThreshold(int gridStyle)
                           throws ChartException
Set the style of the grid threshold. By default, grid threshold lines are solid (GRID_LINE_SOLID). Grid threshold styles are applicable to the time axis only -- grid threshold lines are drawn at significant dimension boundaries.

For example, suppose the time axis is defined at 10 minute intervals, and days and hours are labeled. In this case, grid lines will be drawn each hour; the grid lines on day boundaries are drawn in the style of the Threshold grid.

Parameters:
gridStyle - Valid values are GRID_LINE_SOLID, GRID_LINE_DASHED or GRID_LINE_DASHED2.

getDrawGrid

public boolean getDrawGrid()
Get the drawGrid flag.

getColor

public java.awt.Color getColor()
Get the color of the grid.

getGridStyle

public int getGridStyle()
Get the line style of the grid.

getGridStyleThreshold

public int getGridStyleThreshold()
Get the line style of the grid threshold.

Chart Builder API (beta)