EspressChart
v 5.5

quadbase.util
Interface IAxis


public interface IAxis

This interface is used to set/get different properties associated with a chart's axis. User's can get a handle to an object of this type by calling the following functions defined in QbChart.

     gethXAxis()
     gethYAxis()
     gethZAxis()
     getAxis(int index)
 
Various properties for an axis can be set/get by using the handle obtained for that axis as described above.


Method Summary
 boolean areTickersInward()
          This function is used to check if the tickers are drawn inward for the given axis.
 boolean areTickersVisible()
          This function is used to check if the tickers are drawn for the given axis.
 double getBaseForLog()
          This function is used to return a base for logarithmic for that axis.
 java.awt.Color getColor()
          Retrieve the color used to draw the axis.
 java.awt.Color getGridColor()
          This function is used to get the grid color of the axis(2D) or wall(3D).
 int getGridThickness()
          This function returns the thickness value of the X/Y grid lines.
 ILabel gethLabel()
          This function is used to get a handle to ILabel, which is used to set properties associated with the labels for the axis.
 ITextString gethTitle()
          This function is used to get a handle to ITextString, which is used to set properties associated with the title for the axis.
 IFormat getLabelFormat()
          This function is used to get the label format for the given axis.
 int getLabelRowCount()
          This function returns the number of rows used to display the x labels.
 int getLabelStep()
          This function returns the step size for the label display.
 int getLabelUnit()
          This function is used to obtain the unit information of the label Label unit is associated with the individual column not the axis.
 boolean getLogSubTickersState()
          This function is used to check if sub-tickers are drawn for that axis.
Log scale must be on and log base must be 10.
 java.lang.Number getMaxScale()
          Returns the maximum scale value that was defined for this axis.
 java.lang.Number getMinScale()
          Returns the minimum scale value that was defined for this axis.
 java.lang.Number getOffset()
          Returns the offset of the x-axis origin from the 0th position.
 java.lang.Object[] getOriginalTickerLabels(boolean formatedLabel)
          This function is used to get the original ticker labels or formatted ticker labels.
 java.lang.Number getScaleStep()
          Retruns the scale step size(interval) for this axis.
 int getThickness()
          This function is used to get the axis line thickness for a 2D chart.
 java.awt.Color getTickerColor()
          This function is used to get the ticker color of the axis(2D) or wall(3D).
 int getTickerLabelsCount()
          This function is used to get the ticker labels count.
 int getTickerStep()
          This function is used to retrieve the ticker step size for the given axis.
 boolean hasArrowhead()
          This function is used to check if arrow heads are currently drawn on the axes of the chart.
 boolean isAxisPaddingAdded()
          This function is used to check if the axis padding is added or not.
 boolean isDateTimeDisplay()
          Returns if the value axis label are displayed in DateTimeFormat, as opposed to NumericFormat.
 boolean isDisplayByWeek()
          Returns the state of the x-axis label display in day of the week fashion.
 boolean isDisplayLabelAsDate()
          Checks if numeric inputs for this axis is being displayed in the DateTime format.
 boolean isGridAlignedWithTicker()
          This function is used to check if grid lines are aligned with tickers.
 boolean isGridInFront()
          This function is used to check if grid lines are in front of the chart.
 boolean isGridVisible()
          This function returns the drawing status of the axis/wall grid.
 boolean isLabelOutsidePlotArea()
          This function is used to check if the tickers and labels are drawn outside chart plot area.
 boolean isLogScale()
          This function is used to check if a logarithmic scale is plotted for that axis.
 boolean isOriginAutomatic()
          This function is used to check if the origin is calculated automatically or not The axis being checked depends on the axis handle used.
 boolean isScaleAutomatic()
          This function is used to check if the scale min, max, and step sizes are calculated automatically or not.
 boolean isShowLogValue()
          This function is used to check if a logarithmic value is shown for that axis.
 boolean isSkipGridOffset()
          This function returns the status of skipping gridline offset.
 boolean isVisible()
          Get the display status of the x, y, or z axis (2D) or xy, yz, xz wall (3D) for the chart.
 void setArrowhead(boolean drawArrows)
          This function is used to draw/hide arrow heads on the axes in the chart.
 void setAxisPaddingAdded(boolean b)
          This function is used to enable/ disable adding axis adding.
 void setBaseForLog(double logBase)
          This function is used to set a base for logarithmic for that axis.
 void setColor(java.awt.Color c)
          Set the color for all the axes.
 void setDateTimeDisplay(boolean state)
          Specifies if the value axis labels are displayed in the DateTimeFormat
 void setDisplayByWeek(boolean state)
          Sets the state of the x-axis label display in day of the week fashion.
 void setDisplayLabelAsDate(boolean b)
          Sets numeric inputs for this axis to be displayed in the DateTime format.
 void setGridAlignedWithTicker(boolean b)
          This function enables/disables the alignment between grid lines and tickers.
 void setGridColor(java.awt.Color c)
          This function sets the grid color of the axis or wall.
 void setGridInFront(boolean b)
          Bring the grid to the front.
 void setGridThickness(int t)
          This function sets the thickness of the x/y grid lines.
 void setGridVisible(boolean b)
          This function enables/disables the drawing of grid lines for the axis associated with this object.
 void setLabelFormat(IFormat format)
          This function sets the label format for the given axis.
 void setLabelOutsidePlotArea(boolean b)
          This function is used to draw tickers and labels inside/outside chart plot area for the given axis.
 void setLabelRowCount(int numRows)
          This function is used to set the number of rows used to display x-axis labels.
 void setLabelStep(int size)
          This function sets the label step size for the given axis.
 void setLogScale(boolean b)
          This function enables/disables log scale plotting for the given axis.
 void setLogSubTickersState(boolean state)
          This function enables/disables sub-tickers for that axis.
Log scale must be on and log base must be 10.
 void setMaxScale(java.lang.Number maxScale)
          Sets the maximum scale value for this axis.
 void setMinScale(java.lang.Number minScale)
          Sets the minimum scale value for this axis.
 void setOffset(java.lang.Number num)
          Sets the offset of the x-axis from the origin.
 void setOriginAutomatic(boolean b)
          This function is used to enable/disable auto calculation of origin.
 void setScaleAutomatic(boolean b)
          This function is used to enable/disable auto calculation of scales.
 void setScaleStep(int yr, int mo, int dd, int hr, int min)
          Sets the scalestep value for this axis.  Used when the scale step uses a date/time/timestamp instead of a number.
 void setScaleStep(java.lang.Number scaleStep)
          Sets the scale step size(interval) for this axis.
 void setShowLogValue(boolean b)
          This function enables/disables show log value for the given axis.
 void setSkipGridOffset(boolean b)
          This function enables/disables grid line offset for the axis associated with this object.
 void setThickness(int t)
          This function is used to set the axis line thickness for a 2D chart.
 void setTickerColor(java.awt.Color c)
          This function sets the ticker color of the axis or wall.
 void setTickerLabels(java.lang.String[] labels)
          This function is used to set the ticker labels for the given axis.
 void setTickersInward(boolean b)
          This function is used to decide the axis tickers drawing direction.
 void setTickerStep(int stepSize)
          This function is used to set the ticker step size for a particular axis.
 void setTickersVisible(boolean b)
          This function is used to enable/disable axis tickers rendering for the given axis.
 void setVisible(boolean b)
          Enables/Disables the display of the particular chart axis or wall.
 

Method Detail

getColor

public java.awt.Color getColor()
Retrieve the color used to draw the axis.

Associated QbChart property: AXIS_COLOR

Note: This method returns the same value for all the axes. i.e. all the axes share the same color.

Returns:
Color An object of type Color for all the axes.

setColor

public void setColor(java.awt.Color c)
Set the color for all the axes.

Associated QbChart property: AXIS_COLOR

Note: All the axes share the same color value.

Parameters:
c - An object of type Color, used to set the color for that axis.

hasArrowhead

public boolean hasArrowhead()
This function is used to check if arrow heads are currently drawn on the axes of the chart.

Associated QbChart property: DRAW_ARROWHEAD

Returns:
boolean True if arrowheads are currently displayed. False otherwise.

setArrowhead

public void setArrowhead(boolean drawArrows)
This function is used to draw/hide arrow heads on the axes in the chart.

Associated QbChart property: DRAW_ARROWHEAD

Note: It applies to all the axes. i.e. Arrowheads, when enabled, appear on ALL the axes.

Parameters:
drawArrows - set to true if arrow heads are desired.

getThickness

public int getThickness()
This function is used to get the axis line thickness for a 2D chart.

Associated QbChart property: AXISLINE_THICKNESS

Returns:
The thickness value associated with the axes as an integer.

setThickness

public void setThickness(int t)
This function is used to set the axis line thickness for a 2D chart. The line thickness is set for all the axes at the same time.

Associated QbChart property: AXISLINE_THICKNESS

Parameters:
t - The thickness (int) desired for the axes.

isVisible

public boolean isVisible()
Get the display status of the x, y, or z axis (2D) or xy, yz, xz wall (3D) for the chart. The particular axis or plane checked depends on the axis handle being used to call this function.

Associated QbChart property:


           DRAW_XAXIS
           DRAW_YAXIS
           DRAW_ZAXIS
 
Returns:
True if axis/plane is displayed, False otherwise

setVisible

public void setVisible(boolean b)
Enables/Disables the display of the particular chart axis or wall. Again, the axis or wall changed depends upon the axis handle used.

Associated QbChart property:


           DRAW_XAXIS
           DRAW_YAXIS
           DRAW_ZAXIS
 
Parameters:
b - True if axis/wall needs to be displayed. False otherwise.

isScaleAutomatic

public boolean isScaleAutomatic()
This function is used to check if the scale min, max, and step sizes are calculated automatically or not. The axis being checked depends on the axis handle used.

Associated QbChart property:


           XAXIS_AUTOSCALE
           YAXIS_AUTOSCALE
           ZAXIS_AUTOSCALE
 
Returns:
True if the scale min, max, and step values are automatic.

setScaleAutomatic

public void setScaleAutomatic(boolean b)
This function is used to enable/disable auto calculation of scales.
Parameters:
b - True if auto scale is desired, false otherwise.
See Also:
isScaleAutomatic for a list of the associated properties.

isOriginAutomatic

public boolean isOriginAutomatic()
This function is used to check if the origin is calculated automatically or not The axis being checked depends on the axis handle used.

Associated QbChart property:


           XAXIS_AUTOSCALE
           YAXIS_AUTOSCALE
           ZAXIS_AUTOSCALE
 
Returns:
True if the origin value is automatic.

setOriginAutomatic

public void setOriginAutomatic(boolean b)
This function is used to enable/disable auto calculation of origin.
Parameters:
b - True if auto origin is desired, false otherwise.
See Also:
isOriginAutomatic for a list of the associated properties.

isAxisPaddingAdded

public boolean isAxisPaddingAdded()
This function is used to check if the axis padding is added or not. This feature only works for auto scale.
Returns:
True if axis padding is added.

setAxisPaddingAdded

public void setAxisPaddingAdded(boolean b)
This function is used to enable/ disable adding axis adding. This feature only works for auto scale.
Parameters:
b - True if adding axis padding is desired, false otherwise.
See Also:
isAxisPaddingNeeded for a list of the associated properties.

isLogScale

public boolean isLogScale()
This function is used to check if a logarithmic scale is plotted for that axis. The axis being checked depends on the axis handle used.

Associated QbChart properties:


           XAXIS_LOGSCALE
           YAXIS_LOGSCALE
           ZAXIS_LOGSCALE
Returns:
true if the scale is logarithmic, false otherwise.

setLogScale

public void setLogScale(boolean b)
This function enables/disables log scale plotting for the given axis.
Parameters:
b - True if a log scale is desired, false otherwise.
See Also:
isLogScale()

getBaseForLog

public double getBaseForLog()
This function is used to return a base for logarithmic for that axis. The axis being checked depends on the axis handle used.
Returns:
log base.

setBaseForLog

public void setBaseForLog(double logBase)
This function is used to set a base for logarithmic for that axis. The axis being checked depends on the axis handle used.
Parameters:
logBase - value of logarithmic base.

getLogSubTickersState

public boolean getLogSubTickersState()
This function is used to check if sub-tickers are drawn for that axis.
Log scale must be on and log base must be 10.
Returns:
the state of log sub-tickers.

setLogSubTickersState

public void setLogSubTickersState(boolean state)
This function enables/disables sub-tickers for that axis.
Log scale must be on and log base must be 10.
Parameters:
state - the state of log sub-tickers.

isShowLogValue

public boolean isShowLogValue()
This function is used to check if a logarithmic value is shown for that axis. The axis being checked depends on the axis handle used.
Returns:
true if logarithmic value is shown, false otherwise.

setShowLogValue

public void setShowLogValue(boolean b)
This function enables/disables show log value for the given axis.
Parameters:
b - True if a log value is shown, false otherwise.
See Also:
isShowLogValue()

gethTitle

public ITextString gethTitle()
This function is used to get a handle to ITextString, which is used to set properties associated with the title for the axis.
Returns:
An object of type ITextString
See Also:
ITextString

gethLabel

public ILabel gethLabel()
This function is used to get a handle to ILabel, which is used to set properties associated with the labels for the axis.
Returns:
An object of type ILabel
See Also:
ILabel

getLabelRowCount

public int getLabelRowCount()
This function returns the number of rows used to display the x labels. Associated QbChart property:

           XLABEL_ROWSIZE
 
Returns:
The number of the rows used to draw the labels.

setLabelRowCount

public void setLabelRowCount(int numRows)
This function is used to set the number of rows used to display x-axis labels. It is useful to specify multiple rows when drawing long labels so that they don't overlap. Associated QbChart property:

           XLABEL_ROWSIZE
 
Parameters:
numRows - The number of rows used to draw the labels.

isLabelOutsidePlotArea

public boolean isLabelOutsidePlotArea()
This function is used to check if the tickers and labels are drawn outside chart plot area. It only works for X axis and Y axis of 2D chart. The axis being checked depends on the axis handle being used.
Returns:
True if axis tickers and labels are on the side, false otherwise.

setLabelOutsidePlotArea

public void setLabelOutsidePlotArea(boolean b)
This function is used to draw tickers and labels inside/outside chart plot area for the given axis.
Parameters:
b - set to true to set tickers and labels on the side, false otherwise
See Also:
isLabelOutsidePlotArea()

getOriginalTickerLabels

public java.lang.Object[] getOriginalTickerLabels(boolean formatedLabel)
This function is used to get the original ticker labels or formatted ticker labels. Formatted ticker labels are always converted to String format; non-formatted ticker labels would remain in original data type.
Parameters:
formatedData - set to true to get formatted ticker labels, false otherwise
Returns:
original ticker labels.

getTickerLabelsCount

public int getTickerLabelsCount()
This function is used to get the ticker labels count.
Returns:
number of ticker labels.

setTickerLabels

public void setTickerLabels(java.lang.String[] labels)
This function is used to set the ticker labels for the given axis. Labels will not change if the new label equals null or empty String.
Parameters:
labels - replace original ticker labels with new labels

areTickersVisible

public boolean areTickersVisible()
This function is used to check if the tickers are drawn for the given axis. The axis being checked depends on the axis handle being used. Associated QbChart properties:

           DRAW_XTICKER
           DRAW_YTICKER
           DRAW_ZTICKER
 
Returns:
True if axis tickers are visible, false otherwise.

setTickersVisible

public void setTickersVisible(boolean b)
This function is used to enable/disable axis tickers rendering for the given axis.
Parameters:
b - set to true to see tickers, false otherwise
See Also:
areTickersVisible()

areTickersInward

public boolean areTickersInward()
This function is used to check if the tickers are drawn inward for the given axis. The axis being checked depends on the axis handle being used.
Returns:
True if axis tickers are drawn inward, false otherwise.

setTickersInward

public void setTickersInward(boolean b)
This function is used to decide the axis tickers drawing direction.
Parameters:
b - set to true to draw tickers inward, false otherwise
See Also:
areTickersInward()

getTickerColor

public java.awt.Color getTickerColor()
This function is used to get the ticker color of the axis(2D) or wall(3D).

setTickerColor

public void setTickerColor(java.awt.Color c)
This function sets the ticker color of the axis or wall.
Parameters:
c - The color to be set.
See Also:
getTickerColor()

getGridColor

public java.awt.Color getGridColor()
This function is used to get the grid color of the axis(2D) or wall(3D). Associated QbChart properties:

           XGRID_COLOR
           YGRID_COLOR
           ZGRID_COLOR
 
Returns:
The Color of the grid

setGridColor

public void setGridColor(java.awt.Color c)
This function sets the grid color of the axis or wall.
Parameters:
c - The color to be set.
See Also:
getGridColor()

getGridThickness

public int getGridThickness()
This function returns the thickness value of the X/Y grid lines. Associated QbChart properties:

           XGRIDLINE_THICKNESS
           YGRIDLINE_THICKNESS
 
Returns:
The thickness of the grid lines

setGridThickness

public void setGridThickness(int t)
This function sets the thickness of the x/y grid lines.
Parameters:
t - The thickness desired.
See Also:
getGridThickness()

isGridVisible

public boolean isGridVisible()
This function returns the drawing status of the axis/wall grid. Associated QbChart properties:

           DRAW_XGRID
           DRAW_YGRID
           DRAW_ZGRID
 
Returns:
True if the grid is visible, false otherwise

setGridVisible

public void setGridVisible(boolean b)
This function enables/disables the drawing of grid lines for the axis associated with this object.
Parameters:
b - Set to true if grid lines are desired, false otherwise.
See Also:
isGridVisible()

isSkipGridOffset

public boolean isSkipGridOffset()
This function returns the status of skipping gridline offset.
Returns:
True if skipping gridline offset, false otherwise

setSkipGridOffset

public void setSkipGridOffset(boolean b)
This function enables/disables grid line offset for the axis associated with this object.
Parameters:
b - Set to true if grid line offset is desired, false otherwise.

isGridAlignedWithTicker

public boolean isGridAlignedWithTicker()
This function is used to check if grid lines are aligned with tickers. Only column, bar, stack column, stack bar, 100% column, hilow, hlco, overlay and box charts support this feature.
Returns:
True if the grid lines are aligned with tickers, false otherwise

setGridAlignedWithTicker

public void setGridAlignedWithTicker(boolean b)
This function enables/disables the alignment between grid lines and tickers. Only column, bar, stack column, stack bar, 100% column, hilow, hlco, overlay and box charts support this feature.
Parameters:
b - Set to true if grid lines are aligned with tickers, false otherwise.
See Also:
isGridAlignedWithTicker()

isGridInFront

public boolean isGridInFront()
This function is used to check if grid lines are in front of the chart. This feature only works with 2D charts
Returns:
True if the grid lines are in front of the chart, false otherwise

setGridInFront

public void setGridInFront(boolean b)
Bring the grid to the front. Place the grid lines at the top of the chart. This feature only works with 2D charts
Parameters:
b - Set to true if grid lines are in front of the chart, false otherwise.
See Also:
isGridInFront()

getMinScale

public java.lang.Number getMinScale()
Returns the minimum scale value that was defined for this axis.

Associated QbChart property: AXIS_SCALE

Returns:
An object of type Number containing the minimum scale value.

setMinScale

public void setMinScale(java.lang.Number minScale)
Sets the minimum scale value for this axis.
Parameters:
minScale - The minimum scale value to use.

getMaxScale

public java.lang.Number getMaxScale()
Returns the maximum scale value that was defined for this axis.

Associated QbChart property: AXIS_SCALE

Returns:
An object of type Number containing the maximum scale value.

setMaxScale

public void setMaxScale(java.lang.Number maxScale)
Sets the maximum scale value for this axis.
Parameters:
maxScale - The maximum scale value to use.

getScaleStep

public java.lang.Number getScaleStep()
Retruns the scale step size(interval) for this axis.

Associated QbChart property: AXIS_SCALE

Returns:
An object of type Number containing the scale step size

setScaleStep

public void setScaleStep(java.lang.Number scaleStep)
Sets the scale step size(interval) for this axis.
Parameters:
scaleStep - The step size to use for the scale.

getOffset

public java.lang.Number getOffset()
Returns the offset of the x-axis origin from the 0th position.
Returns:
An object of type Number containing the offset value.

setOffset

public void setOffset(java.lang.Number num)
Sets the offset of the x-axis from the origin.

Associated QbChart property: X_ORIGIN

Parameters:
num - The offset value.

isDisplayLabelAsDate

public boolean isDisplayLabelAsDate()
Checks if numeric inputs for this axis is being displayed in the DateTime format.
Returns:
True if the labels are displayed as date, false otherwise

setDisplayLabelAsDate

public void setDisplayLabelAsDate(boolean b)
Sets numeric inputs for this axis to be displayed in the DateTime format.
Parameters:
b - Set to true if date labels are desired, false otherwise.

setScaleStep

public void setScaleStep(int yr,
                         int mo,
                         int dd,
                         int hr,
                         int min)
Sets the scalestep value for this axis.  Used when the scale step uses a date/time/timestamp instead of a number.
Parameters:
yr - The scalestep in year
mo - The scalestep in month
dd - The scalestep in day
hr - The scalestep in hour
min - The scalestep in minute

isDateTimeDisplay

public boolean isDateTimeDisplay()
Returns if the value axis label are displayed in DateTimeFormat, as opposed to NumericFormat.

setDateTimeDisplay

public void setDateTimeDisplay(boolean state)
Specifies if the value axis labels are displayed in the DateTimeFormat
Parameters:
state - the new state, default is true.

isDisplayByWeek

public boolean isDisplayByWeek()
Returns the state of the x-axis label display in day of the week fashion.

setDisplayByWeek

public void setDisplayByWeek(boolean state)
Sets the state of the x-axis label display in day of the week fashion. Known issues: works for dates as early as from the year 1971. Day of week accuracy is compromised by inaccuracy in the java.util.Date class.
Parameters:
state - the new state.

getTickerStep

public int getTickerStep()
This function is used to retrieve the ticker step size for the given axis. Ticker step sizes are associated with individual axis.
Returns:
The ticker step size.
See Also:
setTickerStep(int)

setTickerStep

public void setTickerStep(int stepSize)
This function is used to set the ticker step size for a particular axis. A step size is the frequency of ticker displayed for an axis. e.g. A step size of 2 means draw a ticker for every 2nd point on the axis. For label filtered date-time chart, a step size of 2 means draw one ticker between labels. (2 equally gap between labels) Ticker step sizes are associated with individual axis.
Parameters:
size - The step size.
See Also:
getTickerStep()

getLabelFormat

public IFormat getLabelFormat()
This function is used to get the label format for the given axis.
Returns:
An object of type IFormat, which contains the label format.
See Also:
IFormat

setLabelFormat

public void setLabelFormat(IFormat format)
This function sets the label format for the given axis.
Parameters:
format - The object of type IFormat containing the label format.
See Also:
IFormat

getLabelUnit

public int getLabelUnit()
This function is used to obtain the unit information of the label Label unit is associated with the individual column not the axis. Use setLabelStep(.....) to set the label unit. No API for setlabelUnit is implemented such that the unit can be consistent with the input data type of the column
Returns:
an integer that represents the unit. -1 (IDataPointSet.TICKER) means it has no unit or the column is not of Date type.
See Also:
IDataPointSet.getLabelUnit() for the definition of the return value specifications.

getLabelStep

public int getLabelStep()
This function returns the step size for the label display. Label step sizes are associated with individual axis.
Returns:
The label step size for that axis.

setLabelStep

public void setLabelStep(int size)
This function sets the label step size for the given axis. This number indicates how frequently the labels are drawn along the axis. Label step sizes are associated with individual axis.
Parameters:
size - The label step size desired.
See Also:
getLabelStep()

EspressChart
v 5.5