|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetcharts.pro.common.NFBaseClass
netcharts.pro.common.rectangular.NFGrid
public class NFGrid
The NFGrid class defines a single "grid". A grid consists of a line style, a background, and a mapping to an X and Y axis. Charts that support grids (any that have X and Y axes) can draw multiple grid overlays. If multiple axes are used, each set of axes can have a unique grid or grids mapped via the axisMap attribute of the grid. As grids are added to a chart, they are stored in a grid series object.
An example of grid usage is shown here:
... NFBarchart bc = new NFBarchart(); // axis NFAxis left = new NFAxis(); left.setScale(0,100,25); left.setTextFont(sansserif); left.setTextColor(Color.gray.brighter()); left.setTicFormat(new NFFormat(NFFormat.FLOAT, "%.3f")); NFAxis right = new NFAxis(); right.setTextFont(sansserif); right.setTextColor(Color.blue); right.setScale(0,20,2); NFGrid grid = new NFGrid(Color.white, Color.blue); grid.setGridLine(NFGridLine.SOLID, 1, Color.gray, NFGridLine.HORIZONTAL); grid.setYAxis(left); // map this grid to left axis. bc.addGrid(grid); // add to chart. NFGrid grid2 = new NFGrid(); grid2.setGridLine(NFGridLine.SOLID, 1, Color.blue.darker(), NFGridLine.BOTH); grid2.setYAxis(right); // map this grid to right axis. bc.addGrid(grid2); // add to chart.The example above creates a barchart that has two grids. The first grid has a white background with blue border and horizontal gray bars. It is mapped to the left and bottom axes. The second grid has no background or border color, but has blue lines mapped to the right and bottom axes.
Constructor Summary | |
---|---|
NFGrid()
Constructs a default grid |
|
NFGrid(java.awt.Color backgroundColor,
java.awt.Color borderColor)
Constructs a grid with the given background, and border color |
|
NFGrid(java.awt.Color lineColor,
java.awt.Color backgroundColor,
java.awt.Color borderColor)
Constructs a grid with the given line, background, and border color |
Method Summary | |
---|---|
java.lang.Object |
clone()
Does a deep copy of this grid object |
NFAxisMap |
getAxisMap()
Returns the axis map for this grid |
NFGridBackground |
getBackground()
Get the grid background |
NFGridLine |
getGridLine()
Get the grid line for this grid. |
void |
setAxisMap(NFAxisMap axisMap)
Set the axis map for this grid |
void |
setBackground(java.awt.Color backgroundColor,
java.awt.Color borderColor)
Convenience method to set this grid's background object. |
void |
setBackground(NFGridBackground background)
Set the grid background. |
void |
setGridLine(java.awt.Color lineColor)
Convenience method to set the grid line for this grid object. |
void |
setGridLine(int style,
int thickness,
java.awt.Color lineColor,
int lineLayout)
Convenience method to set this grid's line. |
void |
setGridLine(NFGridLine gridLine)
Set the grid line. |
void |
setXAxis(NFAxis axis)
Sets which axis should be used to map vertical lines. |
void |
setYAxis(NFAxis axis)
Sets which axis should be used to map horizontal lines. |
Methods inherited from class netcharts.pro.common.NFBaseClass |
---|
getModified, getUserObject, setModified, setUserObject |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NFGrid()
public NFGrid(java.awt.Color backgroundColor, java.awt.Color borderColor)
backgroundColor
- Color of grid background. If null, grid is transparentborderColor
- Color of grid border. If null, border not drawn.public NFGrid(java.awt.Color lineColor, java.awt.Color backgroundColor, java.awt.Color borderColor)
lineColor
- Color of grid linesbackgroundColor
- Color of grid background. If null, grid is transparentborderColor
- Color of grid border. If null, border not drawn.Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class NFBaseClass
java.lang.CloneNotSupportedException
public void setAxisMap(NFAxisMap axisMap)
axisMap
- Axis map to use when drawing grid lines.public NFAxisMap getAxisMap()
public void setXAxis(NFAxis axis)
axis
- NFAxis object to use to map vertical lines.public void setYAxis(NFAxis axis)
axis
- NFAxis object to use to map horizontal lines.public void setGridLine(java.awt.Color lineColor)
lineColor
- Color of grid line.public void setGridLine(int style, int thickness, java.awt.Color lineColor, int lineLayout)
style
- One of NONE, BAR, SOLID, DOTTED, DASHED, DOTDASH
thickness
- Line pixel thicknesslineColor
- Grid line colorlineLayout
- One of HORIZONTAL, VERTICAL, BOTH, NONE
public void setGridLine(NFGridLine gridLine)
gridLine
- NFGridLine object to use when rendering this grid's lines.public NFGridLine getGridLine()
public void setBackground(java.awt.Color backgroundColor, java.awt.Color borderColor)
backgroundColor
- Color of grid backgroundborderColor
- Color of grid borderpublic void setBackground(NFGridBackground background)
background
- NFGridBackground object.public NFGridBackground getBackground()
|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2011 |
Last Modified: Jun 28, 2011 |