((Apenas para componentes do Flex Data Visualization))
Pacotemx.charts.chartClasses
Classepublic class NumericAxis
HerançaNumericAxis Inheritance AxisBase Inheritance EventDispatcher Inheritance Object
Implementa IAxis
Subclasses DateTimeAxis, LinearAxis, LogAxis

The NumericAxis class acts as a common base class for axis types representing a continuous range of values between a defined minimum and maximum. The built-in LinearAxis, LogAxis, and DateTimeAxis classes all extend this base class.

Veja também

mx.charts.DateTimeAxis
mx.charts.LinearAxis
mx.charts.LogAxis


Propriedades Públicas
 PropriedadeDefinido por
  autoAdjust : Boolean
Specifies whether Flex rounds values.
NumericAxis
  baseAtZero : Boolean
Specifies whether Flex tries to keep the minimum and maximum values rooted at zero.
NumericAxis
  baseline : Number
[read-only] The computed minimum value for the axis as long as this value is greater than 0.
NumericAxis
 InheritedchartDataProvider : Object
[write-only] The data provider assigned to the enclosing chart.
AxisBase
  computedMaximum : Number
The computed maximum value represented by this axis.
NumericAxis
  computedMinimum : Number
The computed minimum value represented by this axis.
NumericAxis
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheriteddisplayName : String
The name of the axis.
AxisBase
  labelFunction : Function
Called to format axis values for display as labels.
NumericAxis
  minorTicks : Array
[read-only] An Array of minor tick marks generated to represent this axis.
NumericAxis
  padding : Number
Specifies padding that Flex adds to the calculated minimum and maximum values for the axis when rendering the values on the screen.
NumericAxis
  parseFunction : Function
Specify a parseFunction to customize how the values rendered by your chart are converted into numeric values.
NumericAxis
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 Inheritedtitle : String
The text for the title displayed along the axis.
AxisBase
 InheritedunitSize : Number
[read-only] The size of one unit of data as represented by this axis.
AxisBase
Propriedades Protegidas
 PropriedadeDefinido por
  assignedMaximum : Number
The explicitly assigned maximum value.
NumericAxis
  assignedMinimum : Number
The explicitly assigned minimum value.
NumericAxis
  computedInterval : Number
The computed interval represented by this axis.
NumericAxis
  dataDescriçãos : Array
[read-only] An Array of DataDescrição structures describing the data being represented by the chart.
NumericAxis
  labelCache : Array
The most recent set of AxisLabel objects generated to represent this axis.
NumericAxis
  labelMaximum : Number
The maximum value where a label should be placed.
NumericAxis
  labelMinimum : Number
The minimum value where a label should be placed.
NumericAxis
  minorTickCache : Array
The most recent set of minor tick marks generated to represent this axis.
NumericAxis
  requiredDescribedFields : uint
[read-only] The fields of the DescribeData structure that this axis is interested in.
NumericAxis
  ticks : Array
[read-only] An Array of tick marks for this axis.
NumericAxis
Métodos Públicos
 MétodoDefinido por
  
Constructor.
NumericAxis
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Triggers events that inform the range object when the chart data has changed.
AxisBase
 Inherited
Dispatches an event into the event flow.
EventDispatcher
  
filterCache(cache:Array, field:String, filteredString:String):void
Filters a set of values of arbitrary type to a set of numbers that can be mapped.
NumericAxis
  
Formats values for display in DataTips.
NumericAxis
  
Determines the range to estimate what the axis labels should be.
NumericAxis
  
getLabels(minimumAxisLength:Number):AxisLabelSet
Gets the labels text that is rendered.
NumericAxis
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
  
Maps a position along the axis back to a numeric data value.
NumericAxis
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
mapCache(cache:Array, field:String, convertedField:String, indexValues:Boolean = false):void
Converts a set of values of arbitrary type to a set of numbers that can be transformed into screen coordinates.
NumericAxis
  
Determines how the axis handles overlapping labels.
NumericAxis
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
reduceLabels(intervalStart:AxisLabel, intervalEnd:AxisLabel):AxisLabelSet
Invoked when an AxisRenderer is unable to cleanly render the labels without overlap, and would like the Axis object to reduce the set of labels.
NumericAxis
 Inherited
registerDataTransform(transform:DataTransform, dimensionName:String):void
Each DataTransform that makes use of an axis registers itself with that axis.
AxisBase
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
transformCache(cache:Array, field:String, convertedField:String):void
Maps a set of values from data space to screen space.
NumericAxis
 Inherited
Each DataTransform that makes use of an axis registers itself with that axis.
AxisBase
  
Updates the chart.
NumericAxis
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Métodos Protegidos
 MétodoDefinido por
  
adjustMinMax(minValue:Number, maxValue:Number):void
Adjusts the generated or assigned range of the axis's labels.
NumericAxis
  
Populates the labelCache property with labels representing the current values of the axis.
NumericAxis
  
Builds an Array of positions for the minor tick marks Array that is generated by this axis.
NumericAxis
 Inherited
describeData(requiredFields:uint):Array
AxisBase
  
Protects the range against invalid values for this axis type.
NumericAxis
  
Invalidates the cached labels and tick marks that represent this axis's values.
NumericAxis
Eventos
 Evento Descrição Definido por
 Inherited Dispatched when Flash Player or the and AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited Dispatched when Flash Player loses operating system focus and is becoming inactive.EventDispatcher
Detalhes da propriedade
assignedMaximumpropriedade
protected var assignedMaximum:Number

The explicitly assigned maximum value. If no value has been assigned, this will be NaN. Typically, calculations should be performed with the computedMaximum field.

assignedMinimumpropriedade 
protected var assignedMinimum:Number

The explicitly assigned minimum value. If no value has been assigned, this will be NaN. Typically calculations should be performed with the computedMinimum field.

autoAdjustpropriedade 
autoAdjust:Boolean  [read-write]

Specifies whether Flex rounds values. If false, Flex does not round the values set by the minimum and maximum properties, or modify the default minimum and maximum values.

The default value is true.


Implementação
    public function get autoAdjust():Boolean
    public function set autoAdjust(value:Boolean):void
baseAtZeropropriedade 
baseAtZero:Boolean  [read-write]

Specifies whether Flex tries to keep the minimum and maximum values rooted at zero. If all axis values are positive, the minimum axis value is zero. If all axis values are negative, the maximum axis value is zero.

The default value is true.


Implementação
    public function get baseAtZero():Boolean
    public function set baseAtZero(value:Boolean):void
baselinepropriedade 
baseline:Number  [read-only]

The computed minimum value for the axis as long as this value is greater than 0. If the maximum value is less than or equal to 0, then the baseline property is the computed maximum. If neither value is greater than 0, then the baseline property is 0.


Implementação
    public function get baseline():Number
computedIntervalpropriedade 
protected var computedInterval:Number

The computed interval represented by this axis. The computedInterval is used by the AxisRenderer and Gridlines classes to determine where to render tick marks and grid lines. The NumericAxis base class watches this field for changes to determine if the chart needs to be re-rendered. Derived classes are responsible for computing the value of this field.

computedMaximumpropriedade 
public var computedMaximum:Number

The computed maximum value represented by this axis. If the user has explicitly assigned a maximum value, the computedMaximum and assignedMaximum properties are usually the same. Otherwise, the computedMaximum is generated from the values represented in the chart.

computedMinimumpropriedade 
public var computedMinimum:Number

The computed minimum value represented by this axis. If the user has explicitly assigned a minimum value, the computedMinimum and assignedMinimum properties are usually be the same. Otherwise, the computedMinimum is generated from the values represented in the chart.

dataDescriçãospropriedade 
dataDescriçãos:Array  [read-only]

An Array of DataDescrição structures describing the data being represented by the chart. An axis can use this property to generate values for properties, such as its range.


Implementação
    protected function get dataDescriçãos():Array
labelCachepropriedade 
protected var labelCache:Array

The most recent set of AxisLabel objects generated to represent this axis. This property is null if the axis has been modified and requires new labels. To guarantee that the value of the labelCache property is correct, call the buildLabelCache() method before accessing the labelCache property.

labelFunctionpropriedade 
labelFunction:Function  [read-write]

Called to format axis values for display as labels. A labelFunction has the following signature:

      function function_name(labelValue:Object, previousValue:Object, axis:IAxis):String { ... }
      

If you know the types of the data your function will be formatting, you can specify an explicit type for the labelValue and previousValue parameters.


Implementação
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void
labelMaximumpropriedade 
protected var labelMaximum:Number

The maximum value where a label should be placed. After computing an adjusted minimum value, many axis types expand the range of the axis further to make room for additional rendering artifacts in the chart, such as labels and borders. This value represents the maximum value in the chart before it is adjusted for these artifacts. Typically axes generate labels to make sure this value is labeled, rather than the adjusted maximum of the axis.

labelMinimumpropriedade 
protected var labelMinimum:Number

The minimum value where a label should be placed. After computing an adjusted minimum value, many axis types expand the range of the axis further to make room for additional rendering artifacts in the chart, such as labels and borders. This value represents the minimum value in the chart before it is adjusted for these artifacts. Typically axes will generate labels to make sure this value is labeled, rather than the adjusted minimum of the axis.

minorTickCachepropriedade 
protected var minorTickCache:Array

The most recent set of minor tick marks generated to represent this axis. This property may be null if the axis has been modified and requires new labels and tick marks. Use the public accessor minorTicks to build the minor tick marks on demand.

minorTickspropriedade 
minorTicks:Array  [read-only]

An Array of minor tick marks generated to represent this axis.


Implementação
    public function get minorTicks():Array
paddingpropriedade 
padding:Number  [read-write]

Specifies padding that Flex adds to the calculated minimum and maximum values for the axis when rendering the values on the screen.


Implementação
    public function get padding():Number
    public function set padding(value:Number):void
parseFunctionpropriedade 
parseFunction:Function  [read-write]

Specify a parseFunction to customize how the values rendered by your chart are converted into numeric values. A custom parseFunction is passed a data value and should return a corresponding number representing the same value. By default, this axis uses the ECMA function parseFloat().


Implementação
    public function get parseFunction():Function
    public function set parseFunction(value:Function):void
requiredDescribedFieldspropriedade 
requiredDescribedFields:uint  [read-only]

The fields of the DescribeData structure that this axis is interested in.


Implementação
    protected function get requiredDescribedFields():uint
tickspropriedade 
ticks:Array  [read-only]

An Array of tick marks for this axis.


Implementação
    protected function get ticks():Array
Detalhes do construtor
NumericAxis()Construtor
public function NumericAxis()

Constructor.

Detalhes do método
adjustMinMax()método
protected function adjustMinMax(minValue:Number, maxValue:Number):void

Adjusts the generated or assigned range of the axis's labels. This method is called during the update cycle of the axis. Subclasses can override this method to do special processing on the values. By default, no adjustments are made to the range.

Parâmetros

minValue:Number — The computed minimum value.
 
maxValue:Number — The computed maximum value.

buildLabelCache()método 
protected function buildLabelCache():Boolean

Populates the labelCache property with labels representing the current values of the axis. Subclasses must implement this function. This function is called many times, so you should check to see if the labelCache property is null before performing any calculations.

Retorna
Boolean — true if the labels were regenerated.
buildMinorTickCache()método 
protected function buildMinorTickCache():Array

Builds an Array of positions for the minor tick marks Array that is generated by this axis. Subclasses must implement this function. This function is called automatically by the NumericAxis. You should access the minorTicks property instead of calling this function directly.

Retorna
Array — An Array of positions from 0 to 1 that represent points between the axis minimum and maximum values where minor tick marks are rendered.
filterCache()método 
public function filterCache(cache:Array, field:String, filteredString:String):void

Filters a set of values of arbitrary type to a set of numbers that can be mapped.

Parâmetros

cache:Array — An Array of objects where converted values are read from and stored.
 
field:String — The field of the objects in the cache Array containing the pre-filtered values.
 
filteredString:String — The field of the objects in the cache Array where filtered values should be stored.

formatForScreen()método 
public function formatForScreen(value:Object):String

Formats values for display in DataTips. Returns a user-readable string.

Parâmetros

value:Object — The value to convert to a String.

Retorna
String — The text of the DataTip.
getLabelEstimate()método 
public function getLabelEstimate():AxisLabelSet

Determines the range to estimate what the axis labels should be. The axis almost immediately calls the getLabels() method to get the real values. The axis uses the estimated values to adjust chart margins, so any difference between the estimated labels and actual labels (returned from the getLabels() method) results in scaling the labels to fit.

An axis need only return the minimum and maximum labels when returning an estimate. If the label set is fairly static, without depending on the size of the axis being rendered on screen, an axis can return the entire label set from this function, and mark the estimate as accurate.

Retorna
AxisLabelSet — An Array of AxisLabel objects.
getLabels()método 
public function getLabels(minimumAxisLength:Number):AxisLabelSet

Gets the labels text that is rendered. When Flex calls this method, the axis has already determined the minimum length of the label.

Parâmetros

minimumAxisLength:Number — The minimum length of the axis, in pixels. The axis can be longer than this value, but not shorter.

Retorna
AxisLabelSet — An array of AxisLabel objects.
guardMinMax()método 
protected function guardMinMax(min:Number, max:Number):Array

Protects the range against invalid values for this axis type. This function is called during the update cycle of the axis to guarantee that invalid ranges are not generated. Subclasses can override this class and define logic that is appropriate to their axis type.

Parâmetros

min:Number — The computed minimum value.
 
max:Number — The computed maximum value.

Retorna
Array — null if no adjustment is necessary, or an Array containing the adjusted values of the form [min,max].
invalidateCache()método 
protected function invalidateCache():void

Invalidates the cached labels and tick marks that represent this axis's values. Derived classes should call this function whenever values used in the calculation of labels and tick marks change.

invertTransform()método 
public function invertTransform(value:Number):Object

Maps a position along the axis back to a numeric data value.

Parâmetros

value:Number — The bound of the axis. This parameter should be between 0 and 1, with 0 representing the minimum bound of the axis, and 1 the maximum.

Retorna
Object
mapCache()método 
public function mapCache(cache:Array, field:String, convertedField:String, indexValues:Boolean = false):void

Converts a set of values of arbitrary type to a set of numbers that can be transformed into screen coordinates.

Parâmetros

cache:Array — An Array of objects where converted values are read from and stored.
 
field:String — The field of the objects in the cache Array containing the pre-converted values.
 
convertedField:String — The field of the objects in the cache Array where converted values should be stored.
 
indexValues:Boolean (default = false) — This parameter is true if the values being mapped are index values, and false if they are natural data values.

preferDropLabels()método 
public function preferDropLabels():Boolean

Determines how the axis handles overlapping labels. Typically, numeric ranges return true, while discrete value-based ranges do not. You can can override this property by setting it directly on the axis.

Retorna
Booleantrue if labels can be dropped without loss of data; otherwise, false.
reduceLabels()método 
public function reduceLabels(intervalStart:AxisLabel, intervalEnd:AxisLabel):AxisLabelSet

Invoked when an AxisRenderer is unable to cleanly render the labels without overlap, and would like the Axis object to reduce the set of labels. The method is passed the two labels that are overlapping.

Parâmetros

intervalStart:AxisLabel — The start of the interval where labels overlap.
 
intervalEnd:AxisLabel — The end of the interval where labels overlap.

Retorna
AxisLabelSet — A new label set that resolves the overlap by reducing the number of labels.
transformCache()método 
public function transformCache(cache:Array, field:String, convertedField:String):void

Maps a set of values from data space to screen space.

Parâmetros

cache:Array — An Array of objects where mapped values are read from and stored.
 
field:String — The field of the objects in the cache Array containing the pre-mapped values.
 
convertedField:String — The field of the objects in the cache Array where mapped values should be stored.

update()método 
public function update():void

Updates the chart. This can be called multiple times per frame.