com.sencha.gxt.chart.client.chart.axis
Class Axis<M,V>

java.lang.Object
  extended by com.sencha.gxt.chart.client.chart.axis.Axis<M,V>
Type Parameters:
M - the data type of the axis
V - the variable type of axis
All Implemented Interfaces:
AxisHandler.HasAxisHandlers, AxisItemOutEvent.HasAxisItemOutHandlers, AxisItemOverEvent.HasAxisItemOverHandlers, AxisSelectionEvent.HasAxisSelectionHandlers
Direct Known Subclasses:
CartesianAxis, GaugeAxis, RadialAxis

public abstract class Axis<M,V>
extends Object
implements AxisHandler.HasAxisHandlers, AxisItemOutEvent.HasAxisItemOutHandlers, AxisItemOverEvent.HasAxisItemOverHandlers, AxisSelectionEvent.HasAxisSelectionHandlers

Defines axis for charts. The axis position, type, style can be configured. The axes are defined in an axes array of configuration objects where the type, field, grid and other configuration options can be set. To know more about how to create a Chart please check the Chart class documentation.


Constructor Summary
Axis()
          Create an axis.
 
Method Summary
 HandlerRegistration addAxisHandler(AxisHandler handler)
          Adds a AxisHandler handler for AxisSelectionEvent, AxisItemOutEvent, AxisItemOverEvent events.
 HandlerRegistration addAxisItemOutHandler(AxisItemOutEvent.AxisItemOutHandler handler)
          Adds a AxisItemOutEvent.AxisItemOutHandler handler for AxisItemOutEvent events.
 HandlerRegistration addAxisItemOverHandler(AxisItemOverEvent.AxisItemOverHandler handler)
          Adds a AxisItemOverEvent.AxisItemOverHandler handler for AxisItemOverEvent events.
 HandlerRegistration addAxisSelectionHandler(AxisSelectionEvent.AxisSelectionHandler handler)
          Adds a AxisSelectionEvent.AxisSelectionHandler handler for AxisSelectionEvent events.
 void delete()
          Removes all the sprites of the axis from the surface.
abstract  void drawAxis(boolean init)
          Renders the axis into the screen and updates it's position.
abstract  void drawLabels()
          Renders the labels in the axes.
 PathSprite getAxisConfig()
          Returns the configuration for the axis lines.
 PreciseRectangle getBBox()
          Returns the bounding box of the axis.
 Chart<M> getChart()
          Returns the chart that the axis is currently attached.
 double getFrom()
          Returns the starting value of the axis.
 TextSprite getLabelConfig()
          Returns the configuration for labels on the axis.
 LabelProvider<V> getLabelProvider()
          Returns the LabelProvider used to provide labels displayed on the axis.
abstract  Chart.Position getPosition()
          Returns the Chart.Position of the axis.
 int getSteps()
          Returns the steps of the axis.
 TextSprite getTitleConfig()
          Returns the configuration of the title.
 double getTo()
          Returns the ending value of the axis.
 double getX()
          Returns the x-coordinate of the axis.
 double getY()
          Returns the y-coordinate of the axis.
 boolean isDisplayGrid()
          Returns whether or not the axis has a grid.
 boolean isHidden()
          Returns whether or not the axis is hidden.
 void onMouseDown(PrecisePoint point)
          Method used when the axis is clicked.
 int onMouseMove(PrecisePoint point)
          Method used when the axis is moused over.
 void onMouseOut(PrecisePoint point)
          Method used when the mouse leaves the axis.
 void removeToolTip()
          Removes the components tooltip (if one exists).
 void setAxisConfig(PathSprite axisConfig)
          Sets the configuration for the axis lines.
 void setChart(Chart<M> chart)
          Sets the chart that the axis is attached.
 void setDisplayGrid(boolean displayGrid)
          Sets whether or not the axis has a grid.
 void setHidden(boolean hidden)
          Sets whether or not the axis is hidden.
 void setLabelConfig(TextSprite labelConfig)
          Sets the configuration for labels on the axis.
 void setLabelProvider(LabelProvider<V> labelProvider)
          Sets the LabelProvider used to provide labels displayed on the axis.
 void setSteps(int steps)
          Sets the number of steps on the axis.
 void setTitleConfig(TextSprite titleConfig)
          Sets the configuration of the title.
 void setToolTipConfig(AxisToolTipConfig<M> config)
          Sets the tooltip configuration.
 void setX(double x)
          Sets the x-coordinate of the axis.
 void setY(double y)
          Sets the y-coordinate of the axis.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Axis

public Axis()
Create an axis.

Method Detail

addAxisHandler

public HandlerRegistration addAxisHandler(AxisHandler handler)
Description copied from interface: AxisHandler.HasAxisHandlers
Adds a AxisHandler handler for AxisSelectionEvent, AxisItemOutEvent, AxisItemOverEvent events.

Specified by:
addAxisHandler in interface AxisHandler.HasAxisHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addAxisItemOutHandler

public HandlerRegistration addAxisItemOutHandler(AxisItemOutEvent.AxisItemOutHandler handler)
Description copied from interface: AxisItemOutEvent.HasAxisItemOutHandlers
Adds a AxisItemOutEvent.AxisItemOutHandler handler for AxisItemOutEvent events.

Specified by:
addAxisItemOutHandler in interface AxisItemOutEvent.HasAxisItemOutHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addAxisItemOverHandler

public HandlerRegistration addAxisItemOverHandler(AxisItemOverEvent.AxisItemOverHandler handler)
Description copied from interface: AxisItemOverEvent.HasAxisItemOverHandlers
Adds a AxisItemOverEvent.AxisItemOverHandler handler for AxisItemOverEvent events.

Specified by:
addAxisItemOverHandler in interface AxisItemOverEvent.HasAxisItemOverHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addAxisSelectionHandler

public HandlerRegistration addAxisSelectionHandler(AxisSelectionEvent.AxisSelectionHandler handler)
Description copied from interface: AxisSelectionEvent.HasAxisSelectionHandlers
Adds a AxisSelectionEvent.AxisSelectionHandler handler for AxisSelectionEvent events.

Specified by:
addAxisSelectionHandler in interface AxisSelectionEvent.HasAxisSelectionHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

delete

public void delete()
Removes all the sprites of the axis from the surface.


drawAxis

public abstract void drawAxis(boolean init)
Renders the axis into the screen and updates it's position.

Parameters:
init - true if the initial draw call

drawLabels

public abstract void drawLabels()
Renders the labels in the axes.


getAxisConfig

public PathSprite getAxisConfig()
Returns the configuration for the axis lines.

Returns:
the configuration for the axis lines

getBBox

public PreciseRectangle getBBox()
Returns the bounding box of the axis.

Returns:
the bounding box of the axis

getChart

public Chart<M> getChart()
Returns the chart that the axis is currently attached.

Returns:
the chart that the axis is currently attached

getFrom

public double getFrom()
Returns the starting value of the axis.

Returns:
the starting value of the axis

getLabelConfig

public TextSprite getLabelConfig()
Returns the configuration for labels on the axis.

Returns:
the configuration for labels on the axis

getLabelProvider

public LabelProvider<V> getLabelProvider()
Returns the LabelProvider used to provide labels displayed on the axis.

Returns:
the label provider used to provide labels displayed on the axis

getPosition

public abstract Chart.Position getPosition()
Returns the Chart.Position of the axis.

Returns:
the position of the axis

getSteps

public int getSteps()
Returns the steps of the axis.

Returns:
the steps of the axis

getTitleConfig

public TextSprite getTitleConfig()
Returns the configuration of the title.

Returns:
the configuration of the title

getTo

public double getTo()
Returns the ending value of the axis.

Returns:
the ending value of the axis

getX

public double getX()
Returns the x-coordinate of the axis.

Returns:
the x-coordinate of the axis

getY

public double getY()
Returns the y-coordinate of the axis.

Returns:
the y-coordinate of the axis

isDisplayGrid

public boolean isDisplayGrid()
Returns whether or not the axis has a grid.

Returns:
true if grid

isHidden

public boolean isHidden()
Returns whether or not the axis is hidden.

Returns:
true if hidden

onMouseDown

public void onMouseDown(PrecisePoint point)
Method used when the axis is clicked.

Parameters:
point - the point clicked

onMouseMove

public int onMouseMove(PrecisePoint point)
Method used when the axis is moused over.

Parameters:
point - the point moused over
Returns:
the index of the moused over item

onMouseOut

public void onMouseOut(PrecisePoint point)
Method used when the mouse leaves the axis.

Parameters:
point - the point left

removeToolTip

public void removeToolTip()
Removes the components tooltip (if one exists).


setAxisConfig

public void setAxisConfig(PathSprite axisConfig)
Sets the configuration for the axis lines.

Parameters:
axisConfig - the configuration for the axis lines

setChart

public void setChart(Chart<M> chart)
Sets the chart that the axis is attached.

Parameters:
chart - the chart that the axis is attached

setDisplayGrid

public void setDisplayGrid(boolean displayGrid)
Sets whether or not the axis has a grid.

Parameters:
displayGrid - true if grid

setHidden

public void setHidden(boolean hidden)
Sets whether or not the axis is hidden.

Parameters:
hidden - true if hidden

setLabelConfig

public void setLabelConfig(TextSprite labelConfig)
Sets the configuration for labels on the axis.

Parameters:
labelConfig - the configuration for labels on the axis

setLabelProvider

public void setLabelProvider(LabelProvider<V> labelProvider)
Sets the LabelProvider used to provide labels displayed on the axis.

Parameters:
labelProvider - the label provider used to provide labels displayed on the axis

setSteps

public void setSteps(int steps)
Sets the number of steps on the axis.

Parameters:
steps - the number of steps on the axis

setTitleConfig

public void setTitleConfig(TextSprite titleConfig)
Sets the configuration of the title.

Parameters:
titleConfig - the configuration of the title

setToolTipConfig

public void setToolTipConfig(AxisToolTipConfig<M> config)
Sets the tooltip configuration.

Parameters:
config - the tooltip configuration

setX

public void setX(double x)
Sets the x-coordinate of the axis.

Parameters:
x - the x-coordinate of the axis

setY

public void setY(double y)
Sets the y-coordinate of the axis.

Parameters:
y - the y-coordinate of the axis


Copyright © 2011. All Rights Reserved.