ilog.views.chart
Class IlvScale

ilog.views.chart.IlvScale

public class IlvScale

Represents a scale that can be connected to a chart axis.

Scales might be defined as a graphical representation of a chart axis. As such, a scale is always associated with an IlvAxis instance. The axis to bind to a scale is determined when a scale is added to a chart, using the IlvChart.setXScale and IlvChart.setYScale methods.

A scale is composed of:

Here is a figure showing the different parts of a scale:


CSS example:

chartScale {
    class : "ilog.views.chart.IlvScale";
    annotations[0] : "@#ilvScaleAnnotation1";
    annotations[1] : "@#ilvScaleAnnotation2";
    autoCrossing : "false";
    autoSide : "false";
    autoWrapping : "false";
    axisStroke : "@#stroke";
    axisVisible : "false";
    category : "false";
    crossingValue : "3.0";
    drawOrder : "2";
    foreground : "green";
    labelAlignment : "LEFT";
    labelColor : "green";
    labelFont : "sansserif-BOLD-8";
    labelOffset : "2";
    labelRotation : "3.0";
    labelVisible : "false";
    majorTickSize : "2";
    majorTickVisible : "false";
    minorTickSize : "2";
    minorTickVisible : "false";
    side : "LOWER";
    skipLabelMode : "CONSTANT";
    skippingLabel : "false";
    stepsDefinition : "@#ilvCategoryStepsDefinition";
    tickLayout : "INSIDE";
    title : "<value>";
    titleFont : "sansserif-BOLD-8";
    titleOffset : "2";
    titlePlacement : "2";
    titleRotation : "3.0";
    visible : "false";
}


Property Summary
 IlvScaleAnnotation[] annotations
          
Sets the annotations attached to this scale.
 boolean autoCrossing
          
Specifies whether the scale uses a default crossing location.
 boolean autoSide
          
Specifies whether the side of the labels, title and "outside" ticks should be chosen automatically.
 boolean autoWrapping
          
Toggles the automatic wrapping of step labels.
 Stroke axisStroke
          
Specifies the stroke for the axis and ticks.
 boolean axisVisible
          
Toggles the visibility of the axis.
 boolean category
          
Specifies that this scale should display categories.
 java.lang.String class
          
Creates a numeric scale with the step and substep units automatically computed.
 double crossingValue
          
Specifies where this scale crosses its dual axis.
 int drawOrder
          
Sets the drawing order of this scale.
 java.awt.Color foreground
          
Changes the color of the scale axis.
 int labelAlignment
          
Specifies the alignment of step labels.
 java.awt.Color labelColor
          
Changes the color used to display the step labels.
 java.awt.Font labelFont
          
Sets the font used to draw the step labels.
 int labelOffset
          
Specifies the offset between tick marks and labels.
 double labelRotation
          
Specifies the rotation of the step labels.
 boolean labelVisible
          
Toggles the visibility of step labels.
 int majorTickSize
          
Specifies the size of major tick marks.
 boolean majorTickVisible
          
Toggles the visibility of major ticks.
 int minorTickSize
          
Specifies the size of minor tick marks.
 boolean minorTickVisible
          
Toggles the visibility of minor ticks.
 int side
          
Sets the side where to place the labels, title and "outside" ticks.
 int skipLabelMode
          
Specifies how the scale determines the labels to skip.
 boolean skippingLabel
          
Tells the scale to skip step labels when they overlap.
 IlvStepsDefinition stepsDefinition
          
Changes the steps definition.
 int tickLayout
          
Specifies the layout of tick marks.
 java.lang.String title
          
Sets the scale title text.
 java.awt.Font titleFont
          
Sets the title font.
 int titleOffset
          
Specifies the offset between the scale title and the step labels.
 int titlePlacement
          
Sets the title placement.
 double titleRotation
          
Sets the title rotation.
 boolean visible
          
Toggles the visibility of this scale.
 

Property Detail

class

public java.lang.String class

Creates a numeric scale with the step and substep units automatically computed.

CSS example:     class : "ilog.views.chart.IlvScale";


annotations

public IlvScaleAnnotation[] annotations

Sets the annotations attached to this scale.

CSS example:    

annotations[0] : "@#ilvScaleAnnotation1";
annotations[1] : "@#ilvScaleAnnotation2";

See implementing class IlvScaleAnnotation for an example of implementing an annotations.


autoCrossing

public boolean autoCrossing

Specifies whether the scale uses a default crossing location.

Note: The bean property "autoCrossing" must not be specified together with the bean properties "crossing" or "crossingValue".

CSS example:     autoCrossing : "false";


autoSide

public boolean autoSide

Specifies whether the side of the labels, title and "outside" ticks should be chosen automatically.

Note: The bean property "autoSide" must not be specified together with the bean property "side".

CSS example:     autoSide : "false";


autoWrapping

public boolean autoWrapping

Toggles the automatic wrapping of step labels. When the wrapping is turned on, the scale tries to wrap the labels into several lines according to the space available between two steps. The wrapping also takes into account the explicit new line characters ('\n') that are embedded in the label string.

Note: Label wrapping does not check the orientation nor the type of the scale. Similarly, it does not take into account the rotation of scale labels. It should only be enabled for scales whose labels are parallel to the axis.

CSS example:     autoWrapping : "false";


axisStroke

public Stroke axisStroke

Specifies the stroke for the axis and ticks.

CSS example:     axisStroke : "@#stroke";

See implementing class BasicStroke for an example of implementing an axisStroke.


axisVisible

public boolean axisVisible

Toggles the visibility of the axis.

CSS example:     axisVisible : "false";


category

public boolean category

Specifies that this scale should display categories.

CSS example:     category : "false";


crossingValue

public double crossingValue

Specifies where this scale crosses its dual axis. This method has no effect if the chart owning this scale is displayed in 3-D.

Note: The bean property "crossingValue" must not be specified together with the bean properties "autoCrossing" or "crossing".

CSS example:     crossingValue : "3.0";

See Also:
3D

drawOrder

public int drawOrder

Sets the drawing order of this scale.

CSS example:     drawOrder : "2";


foreground

public java.awt.Color foreground

Changes the color of the scale axis.

CSS example:     foreground : "green";

A color can either be a string representing a color or else an octal or hexadecimal string that starts with the character "#" or else a comma separated "RGB" value where the integer values are in the range 0..255.


labelAlignment

public int labelAlignment

Specifies the alignment of step labels. The alignment is only used for multiline labels. It can take the following values:
CSS example:     labelAlignment : "LEFT";

Allowed values:
LEFT    Box-orientation constant used to specify the left side of a box.
CENTER    The central position in an area. Used for both compass-direction constants (NORTH, etc.) and box-orientation constants (TOP, etc.).
RIGHT    Box-orientation constant used to specify the right side of a box.


labelColor

public java.awt.Color labelColor

Changes the color used to display the step labels. If this color is not explicitly specified, the foreground of the scale is used.

CSS example:     labelColor : "green";

A color can either be a string representing a color or else an octal or hexadecimal string that starts with the character "#" or else a comma separated "RGB" value where the integer values are in the range 0..255.


labelFont

public java.awt.Font labelFont

Sets the font used to draw the step labels.

CSS example:     labelFont : "sansserif-BOLD-8";


labelOffset

public int labelOffset

Specifies the offset between tick marks and labels. The default offset is 3.

CSS example:     labelOffset : "2";


labelRotation

public double labelRotation

Specifies the rotation of the step labels.

CSS example:     labelRotation : "3.0";


labelVisible

public boolean labelVisible

Toggles the visibility of step labels.

CSS example:     labelVisible : "false";


majorTickSize

public int majorTickSize

Specifies the size of major tick marks. The default size is 6.

CSS example:     majorTickSize : "2";


majorTickVisible

public boolean majorTickVisible

Toggles the visibility of major ticks.

CSS example:     majorTickVisible : "false";


minorTickSize

public int minorTickSize

Specifies the size of minor tick marks. The default size is 3.

CSS example:     minorTickSize : "2";


minorTickVisible

public boolean minorTickVisible

Toggles the visibility of minor ticks.

CSS example:     minorTickVisible : "false";


side

public int side

Sets the side where to place the labels, title and "outside" ticks.

Note: The bean property "side" must not be specified together with the bean property "autoSide".

CSS example:     side : "LOWER";

Allowed values:
LOWER    Side: Labels, title, and "outside" ticks are drawn towards decreasing values of the dual axis.
UPPER    Side: Labels, title, and "outside" ticks are drawn towards increasing values of the dual axis.


skipLabelMode

public int skipLabelMode

Specifies how the scale determines the labels to skip.

CSS example:     skipLabelMode : "CONSTANT";

Allowed values:
CONSTANT    Skip label type: indicates that the scale computes a constant number of labels to skip to avoid overlapping.
ADAPTIVE    Skip label type: indicates that the scale considers every label from the first to the last, and determines which one should be skipped to avoid overlapping.


skippingLabel

public boolean skippingLabel

Tells the scale to skip step labels when they overlap.

CSS example:     skippingLabel : "false";


stepsDefinition

public IlvStepsDefinition stepsDefinition

Changes the steps definition. This method lets you change the step numbering strategy.

CSS example:     stepsDefinition : "@#ilvCategoryStepsDefinition";

See implementing class IlvCategoryStepsDefinition for an example of implementing a stepsDefinition.


tickLayout

public int tickLayout

Specifies the layout of tick marks.

CSS example:     tickLayout : "INSIDE";

Allowed values:
INSIDE    Tick layout type: ticks are drawn inside the plot area.
OUTSIDE    Tick layout type: ticks are drawn outside the plot area.
CROSS    Tick layout type: ticks are drawn both inside and outside the plot area.


title

public java.lang.String title

Sets the scale title text.

CSS example:     title : "<value>";


titleFont

public java.awt.Font titleFont

Sets the title font.

CSS example:     titleFont : "sansserif-BOLD-8";


titleOffset

public int titleOffset

Specifies the offset between the scale title and the step labels. The default offset is 3.

CSS example:     titleOffset : "2";


titlePlacement

public int titlePlacement

Sets the title placement. The value is expressed as a percentage of the axis length, 0 meaning the title is drawn at the minimum axis value, 100 meaning the title is drawn at the maximum axis value. The default value is 50, meaning the title is drawn in the middle of the scale.

CSS example:     titlePlacement : "2";


titleRotation

public double titleRotation

Sets the title rotation.

CSS example:     titleRotation : "3.0";

See Also:
title

visible

public boolean visible

Toggles the visibility of this scale.

CSS example:     visible : "false";



Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.