Chart FX for Java 6.2

SoftwareFX.ChartFX
Class Axis

java.lang.Object
  extended bySoftwareFX.ChartFX.Axis

public final class Axis
extends java.lang.Object

Provides access to the Axis object.

Axes are one of the most important aspects in a chart since they provide users with a visual means to read and analyze data. Therefore, a charting tool must provide mechanisms to manipulate axis settings programmatically.

Chart FX automatically configures axes accommodating the data that was used to populate the chart. This behavior will minimize the initial programming effort of customizing the chart's axes. However, in some cases programmers will face complex needs like special labeling, scrolling, formatting and scaling that must be addressed via code. To achieve this, Chart FX provides a powerful object-oriented API, so programmers can customize virtually any axis setting.

It's important to be aware that Chart FX supports many different axes: The main Y Axis, the Secondary Y axis and the X-Axis are illustrated in the following figure:

Normally, the X-axis is a categorical axis (although it can also be a numerical axis in XY Plots) and the Y axes are numerical axis that you can independently control through different properties available in the axis object.

One of the major advantages in Chart FX numerical axis handling is the introduction of major and minor units which will allow you to control gridlines, tick marks and labels associated with the axis. For example, you could have a chart where the primary Y axis ranges from 0-100, the labels are position every 25 with a cross tick mark and gridlines position every 12.5 units, as depicted in the following figure.

Multiple Axes

Chart FX supports the configuration of multiple axes in your charts. Most gallery types include two axes by default; however, sometimes another axis can be beneficial in conveying information to the user.

The Axis property is used to create multiple axes. This array property allows you to specify an index so you may create many different axes. Some index values have been reserved such as 0 (primary Y axis), 1 (secondary Y axis) and 2 (primary X axis), therefore, to add an additional axis you must start using the index value 3.

To create an additional axis in your chart, you must specify the desired max and min values the axis will reflect:

//Create and set the Max and Min for axis3
Axis axis3 = chart1.getAxis(3);
axis3.setMax(100);
axis3.setMin(0);

By default, additional axes are configured as a new Y axis (vertical). If you would like a newly create axis to act as an X axis (horizontal) you can use the YAxis property:

//Create axis4
Axis axis4 = chart1.getAxis(4);
//Set as additional Y axis (vertical)
axis4.setYAxis(true);
//Set as additional X axis (horizontal)
axis4.setYAxis(false);

You can also control the axis position relative to the charting area using the Position property. The axis position may be configured to Near, Center or Far. This will control what side of the chart the axis is created.

//Create axis5
Axis axis5 = chart1.getAxis(5);
//Set the axis position to Near
axis5.setPosition(AxisPosition.Near);
//Set the axis position to Far
axis5.setPosition(AxisPosition.Far);

Important Note: When assigning a series to a Secondary Y axis you should make sure that you make the axis assignment before passing data. By doing this, Chart FX will calculate the setMax(double), setMin(double) and setStep(double) for the secondary Y axis automatically. If the axis assignment is done after the data has been passed, you can set the Max, Min and Step manually or call the Chart.recalcScale() method. Please keep in mind that calling the RecalcScale method is a less efficient way to create the chart.

There is no automatic method for aligning a main and secondary axis, it is required that you set the Min and Max in order to align them manually. The generic algorithm used to find these values is the following:

Axis.Min = OtherAxis.Min / (OtherAxis.Max / Axis.Max)


Constructor Summary
Axis()
           
 
Method Summary
 void adjustScale()
          Adjusts the selected axis to "nice" scale values.
 void clearLabels()
          Clears all labels for a selected axis.
 java.awt.Color getAlternateColor()
          Gets or sets the AlternateColor for a selected Axis or AxisSection object.
 double[] getCustomSteps()
          Gets or sets a custom step for the selected axis.
 ValueFormat getDataFormat()
          Used to format the data displayed on point labels and tool tips shown at a mouseover.
 int getFirstLabel()
          Gets or sets a value used to customize the first label displayed on a selected axis.
 java.awt.Font getFont()
          Allows you to change the label Font attributes of the selected axis.
 Line getGrid()
          Returns a Line object used to customize the gridlines for a selected Axis or AxisSection object.
 LabelList getKeyLabel()
          Sets key (short) labels for a selected Axis.
 java.lang.String getKeyLabel(int i)
          Deprecated. You should use getKeyLabel() instead.
 LabelList getLabel()
          Sets labels for a selected Axis.
 java.lang.String getLabel(int i)
          Deprecated. You should use getLabel() instead.
 short getLabelAngle()
          Sets the text rotation for the labels in the selected axis.
 ValueFormat getLabelsFormat()
          Used to format the labels displayed on the selected axis.
 double getLabelValue()
          Allows you to set associate text labels to major tick marks in a numerical axis.
 Line getLine()
          Allows you to apply supported Line class members to a selected axis line.
 Link getLink()
          Gets the Link object for a selected Axis or AxisSection item.
 double getLogBase()
          Used to set a logarithmic scale for a numerical axis and recalculate the values as powers equal to the setting of this property.
 double getMax()
          Defines the maximum value of a specific axis.
 double getMin()
          Defines the minimum value of a selected axis.
 Line getMinorGrid()
          Returns a Line object used to customize the minor gridlines.
 double getMinorStep()
          Specifies the increment you want between minor tick marks and minor gridlines (if they are displayed) on the selected axis.
 int getMinorTickMark()
          Gets or sets the style for the minor tick marks of an Axis or AxisSection object.
 int getPane()
          Gets or sets an integer value specifying the Pane for an Axis object.
 double getPixPerUnit()
          Gives you the ability to control how many pixels per unit are in a selected axis.
 int getPosition()
          Specifies the placement of the axis labels and tick marks relative to the chart.
 double getScaleUnit()
          Gets or sets the scale unit of a selected axis.
 int getScrollPosition()
          Gets or sets the starting scroll position when a chart is scrollable.
 int getScrollSize()
          Gets the number of scrolls in a chart based on the scroll view configuration.
 double getScrollViewMax()
          Returns the maximun value for an axis at the current scroll position.
 double getScrollViewMin()
          Returns the minimum value for an axis at the current scroll position.
 AxisSection getSection(int n)
          Deprecated. You should use getSections() instead.
 AxisSectionCollection getSections()
          Returns a selected AxisSection object.
 int getSeparation()
          Gets or sets a gap value (in pixels) between multiple axis.
 double getStep()
          Specifies the interval of major tick marks and gridlines on the selected axis.
 int getStyle()
          Allows you to add additional styles to the selected axis.
 java.awt.Color getTextColor()
          Gets or sets the color for text of a selected Axis or AxisSection object.
 int getTickMark()
          Gets or sets the style for the tick marks of an Axis or AxisSection object.
 Title getTitle()
          Gets or sets the title object for a specific axis.
 boolean isAutoScale()
          Instructs Chart FX to always recalculate the specified Axis scale values (Min, Max) when new values are set to the chart.
 boolean isForceZero()
          Gets or sets a value indicating whether or not to start an axis mininum value at zero.
 boolean isGridlines()
          Gets or sets a value indicating to show gridlines for the selected Axis or AxisSection object.
 boolean isHorizontal()
          Returns a boolean value specifying whether the select axis is a horizontal or vertical axis.
 boolean isInterlaced()
          Creates a grid of alternating colors for a selected axis to improve chart readability.
 boolean isInverted()
          Gets or sets a value specifying if a selected numerical axis max value is lesser than the min value.
 boolean isMinorGridlines()
          Gets or sets a value indicating whether to show or hide minor gridlines.
 boolean isNotify()
          Used to enable or disable the GetAxisLabel event so you can customize labels on the specified axis.
 boolean isStaggered()
          Alternates the level of the axis labels for the selected axis labels.
 boolean isVisible()
          Shows or hides the lines, labels, tick marks and grids for the selected axis.
 boolean isYAxis()
          Used to set the orientation (X or Y) for a newly created axis.
 double pixelToValue(int xyPixel)
          Converts a position in pixels in the chart area to its value representation on the selected axis.
 void resetScale()
          Prepares the selected axis to receive new data by resetting scale values.
 void setAlternateColor(java.awt.Color value)
          Gets or sets the AlternateColor for a selected Axis or AxisSection object.
 void setAutoScale(boolean value)
          Instructs Chart FX to always recalculate the specified Axis scale values (Min, Max) when new values are set to the chart.
 void setCustomSteps(double[] steps)
          Gets or sets a custom step for the selected axis.
 void setFirstLabel(int value)
          Gets or sets a value used to customize the first label displayed on a selected axis.
 void setFont(java.awt.Font value)
          Allows you to change the label Font attributes of the selected axis.
 void setForceZero(boolean value)
          Gets or sets a value indicating whether or not to start an axis mininum value at zero.
 void setGridlines(boolean value)
          Gets or sets a value indicating to show gridlines for the selected Axis or AxisSection object.
 void setInterlaced(boolean value)
          Creates a grid of alternating colors for a selected axis to improve chart readability.
 void setInverted(boolean value)
          Gets or sets a value specifying if a selected numerical axis max value is lesser than the min value.
 void setKeyLabel(int i, java.lang.String value)
          Deprecated. You should use getKeyLabel() instead.
 void setLabel(int i, java.lang.String value)
          Deprecated. You should use getLabel() instead.
 void setLabelAngle(short value)
          Sets the text rotation for the labels in the selected axis.
 void setLabelValue(double value)
          Allows you to set associate text labels to major tick marks in a numerical axis.
 void setLogBase(double value)
          Used to set a logarithmic scale for a numerical axis and recalculate the values as powers equal to the setting of this property.
 void setMax(double value)
          Defines the maximum value of a specific axis.
 void setMin(double value)
          Defines the minimum value of a selected axis.
 void setMinorGridlines(boolean value)
          Gets or sets a value indicating whether to show or hide minor gridlines.
 void setMinorStep(double value)
          Specifies the increment you want between minor tick marks and minor gridlines (if they are displayed) on the selected axis.
 void setMinorTickMark(int value)
          Gets or sets the style for the minor tick marks of an Axis or AxisSection object.
 void setNotify(boolean value)
          Used to enable or disable the GetAxisLabel event so you can customize labels on the specified axis.
 void setPane(int value)
          Gets or sets an integer value specifying the Pane for an Axis object.
 void setPixPerUnit(double value)
          Gives you the ability to control how many pixels per unit are in a selected axis.
 void setPosition(int value)
          Specifies the placement of the axis labels and tick marks relative to the chart.
 void setScaleUnit(double value)
          Gets or sets the scale unit of a selected axis.
 void setScrollPosition(int value)
          Gets or sets the starting scroll position when a chart is scrollable.
 void setScrollView(double min, double max)
          Calculates the appropriate PixPerUnit and related scale values to create a scroll bar to view a portion of the selected axis.
 void setSeparation(int value)
          Gets or sets a gap value (in pixels) between multiple axis.
 void setStaggered(boolean value)
          Alternates the level of the axis labels for the selected axis labels.
 void setStep(double value)
          Specifies the interval of major tick marks and gridlines on the selected axis.
 void setStyle(int value)
          Allows you to add additional styles to the selected axis.
 void setTextColor(java.awt.Color value)
          Gets or sets the color for text of a selected Axis or AxisSection object.
 void setTickMark(int value)
          Gets or sets the style for the tick marks of an Axis or AxisSection object.
 void setTitle(Title value)
          Gets or sets the title object for a specific axis.
 void setVisible(boolean value)
          Shows or hides the lines, labels, tick marks and grids for the selected axis.
 void setYAxis(boolean value)
          Used to set the orientation (X or Y) for a newly created axis.
 int valueToPixel(double dValue)
          Converts a logical chart value to its position in pixels for a selected axis.
 void zoom(double min, double max)
          Allows you to specify a min and max zoom value for a selected axis.
 void zoomOff()
          Allows you to ignore any zoom attributes set using the Zoom method and return to the default axis view.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Axis

public Axis()
Method Detail

adjustScale

public void adjustScale()

Adjusts the selected axis to "nice" scale values.

Remarks:
  • This method is not useful if the setAutoScale(boolean) member is enabled (true), as Chart FX will recalculate (Chart.recalcScale()) scale values and adjust (AdjustScale) the axis accordingly. But if you disable the AutoScale feature to set your own Min and Max (and Step when applicable) you can use this method to round them to "nice" values.

  • "Nice" values are calculated according to the values associated with the axis in powers of 10, For example:

    If your y axis ranges from 0-18, the AdjustScale method can round the Max value to 20.

    If your y axis ranges from 0-0.56, the AdjustScale method can round the Max Value to 0.6.

    If your y axis ranges from 0-234, the AdjustScale method can round the Max Value to 300.

  • This method will not affect the setStep(double) and setMinorStep(double) if they have been previously set. To make sure they respond to this method make sure the Step and MinorStep properties are set to zero (0).

  • A typical case of when to use this method is when you disable the setAutoScale(boolean) member to calculate your Min and Max and any of them is not a "nice" number because they are being calculated according to the data being sent to the chart. At this time, you can invoke the AdjustScale method so they are rounded to "nice" numbers.

  • See Also:
    setAutoScale(boolean), setMinorStep(double), setStep(double), Chart.recalcScale(), Axis, Chart

    clearLabels

    public void clearLabels()

    Clears all labels for a selected axis.

    Remarks:
  • To can add labels to the desired axis using the getLabel(int) member of the Axis class.

  • You may use the AdjustScale method to adjust the scale of a selected axis to "nice" values.

  • See Also:
    getLabel(int), adjustScale(), Axis

    getAlternateColor

    public java.awt.Color getAlternateColor()

    Gets or sets the AlternateColor for a selected Axis or AxisSection object.

    Remarks:
  • The AlternateColor is used when the selected axis is configured as setInterlaced(boolean). The other color is defined by the configured Chart.setInsideColor(java.awt.Color).

  • The AxisSection.setTextColor(java.awt.Color) property is used to control the color for the text of the selected Axis or AxisSection object.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • Here is an example of an Interlaced Y axis:

  • See Also:
    setInterlaced(boolean), AxisSection.setTextColor(java.awt.Color), getSections(), Chart.setInsideColor(java.awt.Color), Axis, AxisSection

    getCustomSteps

    public double[] getCustomSteps()

    Gets or sets a custom step for the selected axis.

    Remarks:
  • The CustomSteps property holds an array of numbers (double) that specifies the custom step for a selected axis.

  • The step applied to the axis will begin to cycle if your chart contains more points than values specifed in the CustomStep assignment. For example, if you set the CustomStep to (5,10,20,30) the axis step would look like:

    0,5,15,35,65,70,80,100,130,135,...

  • See Also:
    setStep(double), setMinorStep(double), Chart.getAxisX(), Chart.getAxisY(), Chart

    getDataFormat

    public ValueFormat getDataFormat()

    Used to format the data displayed on point labels and tool tips shown at a mouseover.

    Remarks:
  • The Chart.setPointLabelMask(java.lang.String) member will overwrite the settings for point labels. Mouse over tips will retain the DataFormat settings.

  • The getLabelsFormat() member can be used to format the selected axis labels.

  • Setting this property for the chart will also format data viewed via the Chart FX data editor.

  • The DataFormat member returns a ValueFormat object. Please see the ValueFormat class for more information regarding supported members.

  • See Also:
    getLabelsFormat(), Chart.setPointLabelMask(java.lang.String), Chart.setPointLabels(boolean), Chart.getAxisX(), Chart.getAxisY(), Chart.setDataEditor(boolean), Chart, ValueFormat

    getFirstLabel

    public int getFirstLabel()

    Gets or sets a value used to customize the first label displayed on a selected axis.

    Remarks:
  • The setting must be an integer specifying where you want labels to begin. The axis will then follow the setStep(double) associated with it to display subsequent labels.

  • When you set a value for this property, the AutoFirstLabel value of the Axis.Style is overwritten to the value you specify.

  • When using this property in the X Axis of a chart with values ranging from 0 to 1, the axis' setMinorStep(double) is used to calculate which label is the first, second, third, etc. When X Axis values range >1, then the axis' setStep(double) is used for this calculation.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), getLabel(int), getKeyLabel(int), setStep(double), setMinorStep(double), Chart

    getFont

    public java.awt.Font getFont()

    Allows you to change the label Font attributes of the selected axis.

    Remarks:
  • The Font property is used to change the font settings for the labels in the selected axis, if you're trying to change the font settings for the axis title, please refer to the Title.setFont(java.awt.Font) member of the Title object.

  • When setting a font in Chart FX, you should create a new font object with the desired attributes. Then assign that object to the desired chart element.

  • For more information regarding the Font type, please refer to the Java API Documentation.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), Title.setFont(java.awt.Font), Title

    getGrid

    public Line getGrid()

    Returns a Line object used to customize the gridlines for a selected Axis or AxisSection object.

    Remarks:
  • Please see the Line class for the supported members exposed by this property.

  • Use the AxisSection.setGridlines(boolean) member to show or hide the axis gridlines for the AxisSection object.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection classs members.

  • See Also:
    AxisSection.setGridlines(boolean), getSections(), Line, Axis

    getKeyLabel

    public java.lang.String getKeyLabel(int i)
    Deprecated. You should use getKeyLabel() instead.

    See Also:
    LabelList

    getKeyLabel

    public LabelList getKeyLabel()

    Sets key (short) labels for a selected Axis.

    Remarks:
  • The getLabel(int) member is used to assign string labels to the tickmarks in the X axis (when generating charts with a categorical axis). Depending on the amount of points in the chart, these labels may be too long to properly fit in the space allotted for each tickmark in the X axis.

  • Labels customization may be accomplished using the supported members of the Axis object. Remember the size of the chart may also limit the available space to position labels.

  • This property can help you display shorter labels in the X axis while maintaining longer labels in the legend window. Let's give you an example:

    Let's suppose you have assigned the following labels to the X axis using the Label property:

    "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November" and "December"

    Now, these labels may or may not fit in the space allotted for each tickmark in the X axis. Using this property you can assign key labels (shorter strings) like: "Jan","Feb","Mar",Apr", etc... that will be displayed in the X axis itself, while the Legend window will display both the Key Legend and the Legend set with the Label property.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), getLabel(int), Chart.setLegendBox(boolean), Chart.getKeyLeg(int), Chart, LegendBox

    getLabel

    public java.lang.String getLabel(int i)
    Deprecated. You should use getLabel() instead.

    See Also:
    LabelList

    getLabel

    public LabelList getLabel()

    Sets labels for a selected Axis.

    Remarks:
  • This member is used to set labels for a categorical axis. Normally, the X axis is a categorical axis containing labels associated with each major tick mark, while the Y axis is a numerical axis where labels are controlled by the scale (Min, Max, etc) and numerical data contained in the chart.

  • You may configure as many labels as points are available in the chart. These labels will be shown in the major tick marks of the selected axis. Some of them can be left empty so no labels are shown on that specific major tick mark.

  • The frequency of these labels are controlled using the setStep(double) member. Label visual attributes like rotation, color and font are also accessible through the setLabelAngle(short), AxisSection.setTextColor(java.awt.Color), and setFont(java.awt.Font) members, respectively.

  • When used in conjunction with the setLabelValue(double) member, this property can be used to set string values to a numerical axis.

  • You can easily remove all labels set to an axis with the Chart.clearData(int) method.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), setStep(double), setLabelAngle(short), setLabelValue(double), AxisSection.setTextColor(java.awt.Color), setFont(java.awt.Font), Chart.getAxis(int), Chart.clearData(int), Chart

    getLabelAngle

    public short getLabelAngle()

    Sets the text rotation for the labels in the selected axis.

    Remarks:
  • This property accepts an integer (representing degrees) ranging from [-90,90], specifying the rotation angle desired. Set this property to 90 to show labels vertically.

  • In order to set this property you must make sure the font type associated with the axis is a True Type Font.

  • Use a positive number to rotate the labels from lower left to upper right. Use negative degrees to rotate text from upper left to lower right.

  • If you would like to change the angle of PointLabels, you can use the Chart.setPointLabelAngle(short) member of the Chart object.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), getLabel(int), setStyle(int), Chart.setPointLabelAngle(short), Chart.getAxis(int), Chart

    getLabelsFormat

    public ValueFormat getLabelsFormat()

    Used to format the labels displayed on the selected axis.

    Remarks:
  • This property allows you to format axis labels without effecting the format of the data values contained in the chart.

  • You can use the getDataFormat() member to set a format for selected point labels, mouseover tips or values.

  • The LabelsFormat property returns a ValueFormat object. Please see the ValueFormat class for more information regarding supported members.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), getDataFormat(), Chart, ValueFormat

    getLabelValue

    public double getLabelValue()

    Allows you to set associate text labels to major tick marks in a numerical axis.

    This property can get or set the LabelValue assigned to any of the axes.

    Remarks:
  • Normally, labels in a numerical axis are automatically controlled and displayed according to the setMin(double), setMax(double) and setStep(double) members. In some cases, you'll need to associate text labels with a numerical axis (using the getLabel(int) property), but when any of the scale values (Min, Max, Step, etc) change, these labels will no longer serve their purpose as the tick marks will be recalculated according to scale settings.

  • For example, if you have a chart where the Y axis ranges from Min=0 to Max=100 and Step=25, you'll have 4 tick marks on 25,50,75 and 100. By default Chart FX will display numbers (as labels) associated with each tick mark.

    Now let's say you want to associate text labels (instead of the number) with each tick mark in the Y axis and you use the Label Property to set the following text labels: "Twenty-Five", "Fifty", "Seventy-Five", "One Hundred".

    When you do this, everything will work out fine and the 4 tick marks will be labeled accordingly. However, if during the execution of your program or through user interaction, the Step suddenly changes from 25 to 12.5, you'll have 8 tick marks instead of 4 and because you used the Label property with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.

    If you would have set the LabelValue Property to 25, when the Step changes from 25 to 12.5 Chart FX will label every other tick mark and the labels will correspond to their initial setting.

  • Label visual attributes like rotation, color and font are also accessible through the setLabelAngle(short), AxisSection.setTextColor(java.awt.Color), and setFont(java.awt.Font) members, respectively.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), setStep(double), getLabel(int), setLabelAngle(short), AxisSection.setTextColor(java.awt.Color), setFont(java.awt.Font), Chart

    getLine

    public Line getLine()

    Allows you to apply supported Line class members to a selected axis line.

    Remarks:
  • The Line.setColor(java.awt.Color),Line.setWidth(int) and Line.setStyle(int) members of the Line class may be used to customize the appearence of the axis line.

  • The Line.setEndCap(int) and Line.setStartCap(int) members allow you to configured various shapes at the beginning and ending of a selected line.

  • See Also:
    Line.setColor(java.awt.Color), Line.setWidth(int), Line.setStyle(int), Line.setEndCap(int), Line.setStartCap(int), Chart.getAxisX(), Chart.getAxisY(), Line, Axis

    getLink

    public Link getLink()

    Gets the Link object for a selected Axis or AxisSection item.

    Remarks:
  • Developers may obtain the Link object for an axis section item using this property. Using the supported Link class members, developers may configure a URL and Target using the respective members (Link.setUrl(java.lang.String) and Link.setTarget(java.lang.String)).

  • See Also:
    Link.setUrl(java.lang.String), Link.setTarget(java.lang.String), Link

    getLogBase

    public double getLogBase()

    Used to set a logarithmic scale for a numerical axis and recalculate the values as powers equal to the setting of this property.

    Remarks:
  • The LogBase property can be applied only to a numerical axis, a categorical axis will ignore this setting.

  • The LogBase property is a member of the axis object, therefore the axis object must be referenced in order to properly access the LogBase property.

  • No zeros or negative data values are permitted in logarithmic charts.

  • The setStep(double) and setMinorStep(double) configurations must be equal or greater than the LogBase property setting.

  • Resetting the data contained in a chart will not automatically recalculate axis values, unless the Chart.recalcScale() method is called.

  • The LogBase has been set to 10 in the following bar chart:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMin(double), setMax(double), setStep(double), setMinorStep(double), Chart.recalcScale(), Chart

    getMax

    public double getMax()

    Defines the maximum value of a specific axis.

    Gets or sets the Max value assigned to the specified axis.

    Remarks:
  • The Max property can be applied only to a numerical axis, a categorical axis will ignore this setting.

  • The Max property is a member of the axis object, therefore the axis object must be referenced in order to properly access the Max property.

  • If no Max value is specified, Chart FX will automatically set a maximum value according to the data provided, you can use this property to read or write this default value.

  • Resetting the data contained in a chart will not automatically set a new Max value unless the Chart.recalcScale() method is called or the setAutoScale(boolean) member is set to True.

  • The value of the Max property must be greater than the value of the Min property.

  • There is no automatic method for aligning a main and secondary axis, it is required that you set the Min and Max in order to align them manually. The generic algorithm used to find these values is the following:

    Axis.Min = OtherAxis.Min/(OtherAxis.Max / Axis.Max)

  • See Also:
    setAutoScale(boolean), Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMin(double), Chart.recalcScale(), Chart

    getMin

    public double getMin()

    Defines the minimum value of a selected axis.

    Gets or sets the Min value assigned to the specified axis.

    Remarks:
  • The Min property can be applied only to a numerical axis, a categorical axis will ignore this setting.

  • The Min property is a member of the axis object, therefore the axis object must be referenced in order to properly access the Min property.

  • If no Min value is specified, Chart FX will automatically set a minimum value according to the data provided, you can use this property to read or write this default value.

  • Changing the data contained in a chart will not automatically set a new Min value unless the Chart.recalcScale() method is called or the setAutoScale(boolean) member is set to True.

  • The value of the Min property must be lesser than the value of the Max property.

  • There is no automatic method for aligning a main and secondary axis, it is required that you set the Min and Max in order to align them manually. The generic algorithm used to find these values is the following:

    Axis.Min = OtherAxis.Min/(OtherAxis.Max / Axis.Max)

  • See Also:
    setAutoScale(boolean), Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMax(double), Chart.recalcScale(), Chart

    getMinorGrid

    public Line getMinorGrid()

    Returns a Line object used to customize the minor gridlines.

    Remarks:
  • Please see the Line class for the supported members exposed by this property.

  • Control the Step for the minor grids using the setMinorStep(double) member.

  • Use the AxisSection.setMinorGridlines(boolean) member to show or hide the axis gridlines for a selected axis object.

  • The getSections() property returns an AxisSection object which may be configured using the AxisSection and AxisSectionBase classs members.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • See Also:
    AxisSection.setMinorGridlines(boolean), getSections(), Axis, AxisSection

    getMinorStep

    public double getMinorStep()

    Specifies the increment you want between minor tick marks and minor gridlines (if they are displayed) on the selected axis.

    Remarks:
  • This property is used to control the interval of minor tick marks and gridlines in the selected axis. For example, if the selected axis ranges from 0-100 and you have specified a setStep(double) value of 10, labels and gridlines will appear at 10, 20, 30, etc. If you would like to have 5 minor tick marks in each major interval, set the MinorStep to 2. Please note the values for the Step and MinorStep properties are data related.

  • Labels will not appear at minor tick marks.

  • The value of the MinorStep property must be lesser than the value of the setStep(double) member.

  • When using the setFirstLabel(int) member in the X Axis of a chart with values ranging from 0 to 1, the axis' MinorStep is used to calculate which label is the first, second, third, etc. When X Axis values range >1, then the axis' setStep(double) is used for this calculation.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), AxisSection.getMinorGrid(), setAutoScale(boolean), AxisSection.setMinorTickMark(int), setStep(double), setFirstLabel(int), Chart.recalcScale(), Chart

    getMinorTickMark

    public int getMinorTickMark()

    Gets or sets the style for the minor tick marks of an Axis or AxisSection object.

    Values:
    TickMark : Define the different ways of displaying tick marks at the major and minor gridlines on the selected axis.
    ValueDescription
    NONEHides tick marks for the selected axis.
    OUTSIDEDisplays tick marks on the outside of the selected axis.
    INSIDEDisplays tick marks on the inside of the selected axis.
    CROSSDisplays tick marks that cross inside and outside the selected axis.

    Remarks:
  • This property applies only to the minor gridlines, for the major gridlines please refer to the AxisSection.setTickMark(int) member.

  • The tick mark is not the gridline that crosses the entire chart, it is just a reference line that appears on every tick of the minor unit of the axis. If you want to display a gridline that crosses the chart, please refer to the AxisSection.setMinorGridlines(boolean) member.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • See Also:
    AxisSection.setTickMark(int), AxisSection.getMinorGrid(), getSections(), Axis

    getPane

    public int getPane()

    Gets or sets an integer value specifying the Pane for an Axis object.

    Remarks:
  • Additional axes may be assigned to panes in a chart. Once an axis object is assigned to a pane, that pane will be visible in the chart area. Data also associated with the selected axis will also be applied to the configured pane.

  • Use the Chart.getPanes() member to customize that attributes for a selected pane. This property exposes all the supported members of the Pane class.

  • See Also:
    Chart.getPanes(), Chart, Pane

    getPixPerUnit

    public double getPixPerUnit()

    Gives you the ability to control how many pixels per unit are in a selected axis.

    This property is very useful if you want a scroll bar in the selected axis.

    Remarks:
  • If the Chart.setScrollable(boolean) member is set to False, the PixPerUnit will not have any effect on the axis. So make sure the Scrollable property is set to True when using the PixPerUnit property.

  • In the following chart, the X axis PixPerUnit has been set to 60:

    Chart.setScrollable(boolean)Chart.setScrollable(boolean)Chart.setScrollable(boolean)Chart.setScrollable(boolean)

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), setStep(double), Chart.setScrollable(boolean), setScrollView(double, double), Chart

    getPosition

    public int getPosition()

    Specifies the placement of the axis labels and tick marks relative to the chart.

    Values:
    AxisPosition : Specifies the placement of the axis line relative to the chart.
    ValueDescription
    NEARSpecifies the axis line be placed near the chart in the following way: In a X axis, the axis line be below the chart. In Y axis, the axis line be left to the chart.
    CENTERSpecifies that axis line placed in the center of the chart.
    FARSpecifies that axis line is placed far from the chart in the following way: In a X axis, the axis line be above the chart. In a Y axis, the axis line is right to the chart.

    Remarks:
  • The Position property is a member of the axis object, therefore the axis object must be referenced in order to set the property correctly.

  • Multiple axes may be created using the Chart.getAxis(int) member of the chart object.

  • Both X and Y axes have been set to the AxisPosition.FAR position to switch their default locations:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), getLabel(int), AxisSection.setTickMark(int), Chart

    getScaleUnit

    public double getScaleUnit()

    Gets or sets the scale unit of a selected axis.

    Remarks:
  • This property is useful when values passed to chart are large (i.e. 10,000,000). By configuring a reasonable scale unit, charts become easier to read and analyze.

  • The ScaleUnit property is a member of the axis object, therefore the axis object must be referenced in order to set the property correctly.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMax(double), setMin(double), Chart.recalcScale(), Chart

    getScrollPosition

    public int getScrollPosition()

    Gets or sets the starting scroll position when a chart is scrollable.

    Remarks:
  • Whenever applying any scroll attributes to a chart, the chart should be configured as scrollable using the Chart.setScrollable(boolean) member.

  • When setting the ScrollPosition, the specified point will be the first point point included in the chart.

  • The getScrollSize() member is used to read the total number of scrolls in the chart based on the current scroll range.

  • You can set the scroll range using the setScrollView(double, double) method.

  • See Also:
    getScrollSize(), setScrollView(double, double), Chart

    getScrollSize

    public int getScrollSize()

    Gets the number of scrolls in a chart based on the scroll view configuration.

    (Read only)

    Remarks:
  • You may configure the scroll position using the setScrollPosition(int) member.

  • You may set the scroll view for a selected axis using the setScrollView(double, double) property. The getScrollViewMin() and getScrollViewMax() methods may be used to read these values from an axis.

  • See Also:
    setScrollPosition(int), setScrollView(double, double)

    getScrollViewMax

    public double getScrollViewMax()

    Returns the maximun value for an axis at the current scroll position.

    Remarks:
  • Please refer to the setScrollView(double, double) method for more information on the use of this method.

  • See Also:
    getScrollViewMin(), Chart.getAxisX(), Chart.getAxisY(), setScrollView(double, double), Chart

    getScrollViewMin

    public double getScrollViewMin()

    Returns the minimum value for an axis at the current scroll position.

    Remarks:
  • Please refer to the setScrollView(double, double) method for more information on the use of this method.

  • See Also:
    getScrollViewMax(), Chart.getAxisX(), Chart.getAxisY(), setScrollView(double, double), Chart

    getSection

    public AxisSection getSection(int n)
    Deprecated. You should use getSections() instead.

    See Also:
    AxisSectionCollection

    getSections

    public AxisSectionCollection getSections()

    Returns a selected AxisSection object.

    Remarks:
  • This method returns an AxisSection object. Please see the AxisSection object for additional information regarding the supported members.

  • See Also:
    AxisSection

    getSeparation

    public int getSeparation()

    Gets or sets a gap value (in pixels) between multiple axis.

    Remarks:
  • This property is useful when multiple axes are configured and you need to create space for readability.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), Chart

    getStep

    public double getStep()

    Specifies the interval of major tick marks and gridlines on the selected axis.

    It also controls the gap or interval between labels in the selected axis.

    Remarks:
  • Normally, you use this property to control the interval of labels, tick marks and gridlines in the selected axis. For example, if the selected axis ranges from 0 -100 and you want to show labels, tick marks or gridlines every 10 units the appropriate setting for the Step property is 10.

  • This property can also be used for a categorical axis. For example, if your X axis displays labels ranging from January to December and you set the Step property to 2, then the categorical axis will display legends every other month.

  • You can also control a minor interval with the setMinorStep(double) member.

  • If no Step value is specified, Chart FX will automatically set a Step according to the data provided, you can use this property to read or write this default value.

  • Changing the data contained in a chart will not automatically change the Step value. If you want Chart FX to calculate an appropriate Step value automatically set the Step value to 0 (Automatic) or invoke the Chart.recalcScale() method.

  • The value of the Step property must be greater than the value of the setMinorStep(double) member.

  • In the example below, the Step for the Y axis has been set to 50. Notice the tick marks on the Y axis increase by 50:

  • When using the setFirstLabel(int) member in the X Axis of a chart with values ranging from 0 to 1, the axis' setMinorStep(double) is used to calculate which label is the first, second, third, etc. When X Axis values range >1, then the axis' Step is used for this calculation.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), AxisSection.getGrid(), setAutoScale(boolean), AxisSection.setTickMark(int), setMinorStep(double), setFirstLabel(int), Chart.recalcScale(), Chart

    getStyle

    public int getStyle()

    Allows you to add additional styles to the selected axis.

    Values:
    AxisStyle : Define valid Styles for the axis
    ValueDescription
    HIDE_TEXTHides labels for the selected axis.
    NOTIFYSetting this flag will make the chart generate a GetAxisLabel Event every time it needs to draw a legend in the selected axis.
    SHOW_2_LEVELSDisplays staggered labels.
    SINGLE_LINEDo not word-wrap labels.
    BREAK_ZEROThis constant will cause a chart to set the starting point at zero. For example, if you have a bar chart with a minimum value of -50 and turn on this flag the starting point will be zero and you will have bars that go up or down, depending on their value.
    HIDEHides entire axis, including labels and tick marks.
    NOT_CLIPPEDDo not clip the X legends (It is the programmers responsibility to assure that labels don't overlap each other). Setting this flag ON will avoid the RED tags to show when a label is too big, you can also use this flag when you don't want to set labels for every point (i.e. set a label every 20th point).
    INTERLACEDDisplays Interlaced Grid on the selected axis.
    CENTEREDMoves tick mark so that labels are centered between major tick marks.
    ROTATE_TEXTThis setting applies to 3D charts only and it allows the text to be rotated when the chart is rotated.
    LONG_TICKDisplays a long major tick mark that makes the axis label appear enclosed in a box. This setting is used in conjunction with the Centered flag.
    AUTO_SCALESame as AutoScale Property.
    FORCE_ZEROForces minimum to zero when adjusting the axis in a chart where all values are positive.
    DEFAULTThe default value is: SingleLine OR BreakZero OR LongTick OR AutoScale OR ForceZero
    SHOW_ENDSForces ChartFX to display the minimum and maximum value independently from the step set to the chart. For example, if step is 10 and maximum is 95 when this setting is used, the axis will show ...60,70,80,90 and 95.
    NO_ROUND_STEPDo not round the interval of tick marks and gridlines on the selected axis. The values shown on the axis will exactly the same data passed to the chart.
    IGNORE_LABELSIgnores any axis label assignments and displays labels as default.
    GRID_FRONTPaints the axis gridlines on top of the series point markers.
    INVERTEDSets the Max value for the selected axis lesser than the Min value.
    DETECT_AREAInstructs Chart FX to include the area around the axis labels when accessing the axis context menu. By default the menu is only accessible by right-clicking over an axis label.
    SHOW_INTERMEDIATE_LOG_LABELSUsed to display incremental values for charts with logarithmic scale.
    AUTO_MINOR_STEPInstructs Chart FX to calculate the MinorStep automatically.
    AUTO_FIRST_LABELAutomatically positions the first label to the closest number rounded to the axis step.
    AUTO_CENTERInstructs Chart FX to center the labels automatically.
    FIX_RIGHT_ALIGNEDRight justifies label text.

    Remarks:
  • This property is a mask property. This means all settings represent a bit in the word that you need to turn on or off according to what you want. For this purpose you will need to use the bitwise operators (And, Or, Not, Xor) provided by your development tool.

  • Because it is a mask property, you must make sure you use these operators to turn on/off bits and avoid losing previous settings to the property.

    For example, if you want to turn ON the Interlaced setting the right way of setting this property is:

    chart1.getAxisX().setStyle(chart1.getAxisX().getStyle() | AxisStyle.INTERLACED);

    If you type the following code:

    chart1.getAxisX().setStyle(AxisStyle.INTERLACED);
    (WRONG!)

    You will erase all other settings in the property causing an erratic behavior of the library and an incorrect setting of the individual properties which also control these flags.

  • The Axis.Style property supports a flag called AutoFirstLabel (Default=ON) which automatically positions the first label to the closest number rounded to the axis step. For example, if a numeric axis starts at 7 with a Step of 10 and the AutoFirstLabel property is ON, the axis will show labels at 10,20,30 and so on. If the AutoFirstLabel property is turned off labels will be shown at 7,17,27 and so on.

    Note: If the axis contains dates (Date Axis) the AutoFirstLabel property will position the first label at the end of the month. If the AutoFirstLabel is turned OFF, the labels will be shown using the first avaialble date and advanced using the Step property setting.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMax(double), setMin(double), getLabel(int), Chart.recalcScale(), Chart

    getTextColor

    public java.awt.Color getTextColor()

    Gets or sets the color for text of a selected Axis or AxisSection object.

    Remarks:
  • The TextColor member is used to set a color for the specified Axis or AxisSection labels. Please refer to the TextColor property of the Title object to customize the color for the axis title.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection and class members.

  • For more information regarding the Color type, please refer to your development environment documentation.

  • See Also:
    getSections(), Axis, AxisSection

    getTickMark

    public int getTickMark()

    Gets or sets the style for the tick marks of an Axis or AxisSection object.

    Values:
    TickMark : Define the different ways of displaying tick marks at the major and minor gridlines on the selected axis.
    ValueDescription
    NONEHides tick marks for the selected axis.
    OUTSIDEDisplays tick marks on the outside of the selected axis.
    INSIDEDisplays tick marks on the inside of the selected axis.
    CROSSDisplays tick marks that cross inside and outside the selected axis.

    Remarks:
  • This property applies only to the major gridlines, for the minor gridlines please refer to the AxisSection.setMinorTickMark(int) member.

  • The tick mark is not the gridline that crosses the entire chart, it is just a reference line that appears on every tick of the minor unit of the axis. If you want to display a gridline that crosses the chart, please refer to the AxisSection.setGridlines(boolean) member.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection and class members.

  • The major unit is controlled by the setStep(double) member.

  • See Also:
    AxisSection.setMinorTickMark(int), AxisSection.setGridlines(boolean), getSections(), setStep(double), Axis, AxisSection

    getTitle

    public Title getTitle()

    Gets or sets the title object for a specific axis.

    Remarks:
  • The Title property is a member of the axis object; therefore, the axis object must be referenced in order to properly utilize the Title property.

  • This property receives or returns a Title class. Accessing the title object properties you will be able to change attributes like: Alignment, Color, Font,Text, etc.

  • This property is used to get or set title objects for the the axis. To set the chart top title, please refer to the chart object Chart.getTitles() property.

  • You can create a multiple line title by including a new line character inside the title string.

  • Below is a chart with both X and Y Axis titles:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Title.setText(java.lang.String), Chart.getAxis(int), Chart, Title

    isAutoScale

    public boolean isAutoScale()

    Instructs Chart FX to always recalculate the specified Axis scale values (Min, Max) when new values are set to the chart.

    Remarks:
  • If you set a Min or Max value and new data is received by the chart when the AutoScale property is enabled, the scale values will be overwritten by Chart FX. This method will not affect the Step property if it has previously set to a specific value. If you want the AutoScale property to recalculate the setStep(double) value, make sure the Step property is set to zero (0).

  • The Chart.recalcScale() method is used to instruct a chart to recaculate. When called, the chart is re-scaled.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), setMin(double), setMax(double), setStep(double), setMinorStep(double), Chart.recalcScale(), Chart

    isForceZero

    public boolean isForceZero()

    Gets or sets a value indicating whether or not to start an axis mininum value at zero.

    Remarks:
  • By default, Chart FX will set the minimum value of a numerical axis to zero even if the data set starts at a greater value. If you want Chart FX to automatically set the minimum value of the axis to the minimum value in the data passed, set this property to FALSE.

  • This property can also be controlled by the setStyle(int) member and the AS_FORCEZERO flag.

  • This property can also be controlled by the setStyle(int) member and the AS_FORCE_ZERO flag.

  • This property applies to numerical axes only.

  • See Also:
    setStyle(int), Axis

    isGridlines

    public boolean isGridlines()

    Gets or sets a value indicating to show gridlines for the selected Axis or AxisSection object.

    Remarks:
  • The AxisSection.getGrid() member returns a Line object which may be customized using the supported Line class members.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • See Also:
    AxisSection.getGrid(), getSections(), AxisSection, Axis

    isHorizontal

    public boolean isHorizontal()

    Returns a boolean value specifying whether the select axis is a horizontal or vertical axis.

    Remarks:
  • When the return value of this property is True, the selected axis is horizontal. If False, the selected axis is a vertical axis.

  • This property will return False if the selected axis has not been enabled in the chart.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), setYAxis(boolean), Chart

    isInterlaced

    public boolean isInterlaced()

    Creates a grid of alternating colors for a selected axis to improve chart readability.

    Remarks:
  • When set to True, a grid with alternating colors is created for the selected axis. This visual attribute helps end users distinguish the different value ranges in the chart and easily recognize the value for a particular point.

  • Use the AxisSection.setAlternateColor(java.awt.Color) and Chart.setInsideColor(java.awt.Color) members to set the Interlaced colors.

  • If you use this property for both the X and Y axes, the results show overlapping interlaced grids.

  • Here is an example of an Interlaced grid on the Y axis:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), AxisSection.getGrid(), DataEditor.setInterlaced(int), Chart.getAxis(int), Chart, DataEditor

    isInverted

    public boolean isInverted()

    Gets or sets a value specifying if a selected numerical axis max value is lesser than the min value.

    Remarks:
  • For an axis to be inverted using this property, the setting must be applied before Chart FX calculates the scale for the axis. For example before the CloseData or RecalcScale method calls.

  • This property should be applied to a numerical axis. Assignment to categorical axes will not have an effect.

  • This property can only be applied to the X Axis in an XY plot chart. In an XY plot, the X Axis is a numerical axis rather than categorical.

  • When a selected axis is inverted, the alignment of the categorical axis of the chart will be reversed to make the chart more readable.

  • See Also:
    setMax(double), setMin(double), Chart.getAxisY(), Chart.getAxisX(), Chart.recalcScale(), Chart.closeData(int), Chart

    isMinorGridlines

    public boolean isMinorGridlines()

    Gets or sets a value indicating whether to show or hide minor gridlines.

    Remarks:
  • The minor interval is controlled by the setMinorStep(double) member, which must be set in order to use the MinorGrid. You can control the major interval using the setStep(double) member.

  • The AxisSection.getMinorGrid() member returns a Line object which may be customized using the supported Line class members.

  • You can use the AxisSection.setGridlines(boolean) and AxisSection.getGrid() members to configure the major grids for a chart.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • Below the MinorGrid (LightBlue) has been set to True, and the setMinorStep(double) member was set to 1.5:

  • See Also:
    AxisSection.getMinorGrid(), getSections(), Axis, AxisSection

    isNotify

    public boolean isNotify()

    Used to enable or disable the GetAxisLabel event so you can customize labels on the specified axis.

    Remarks:
  • This property can also be controlled by the setStyle(int) member and the Notify flag.

  • Chart FX for Java only supports the GetAxisLabel event when generating charts as .NET client controls and using client side chart events.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setStyle(int), Chart

    isStaggered

    public boolean isStaggered()

    Alternates the level of the axis labels for the selected axis labels.

    Remarks:
  • Staggering axis labels can help improve chart readability when axis label strings are long.

  • You can also set staggered axis labels by using the setStyle(int) member with the SHOW_2LEVELS flag.

  • See Also:
    setStyle(int)

    isVisible

    public boolean isVisible()

    Shows or hides the lines, labels, tick marks and grids for the selected axis.

    Remarks:
  • The Visible property is a member of the axis object; therefore, the axis object must be referenced in order to properly utilize the Visible property.

  • By hiding the labels for the specified axis using the Visible property, other attributes such as the AxisSection.getGrid() and tick marks are also hidden.

  • The X axis has been hidden in the chart below:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), Chart

    isYAxis

    public boolean isYAxis()

    Used to set the orientation (X or Y) for a newly created axis.

    Remarks:
  • When you create a new axis using the Axis property, you may assign the axis as an X or Y axis. When YAxis is set to True, the new axis will be a vertical Y axis. When YAxis is set to False, the new axis will be a horizontal X axis.

  • The setPosition(int) member allows you to position an axis Near or Far.

  • You can use the setSeparation(int) member to modify the gap between axes.

  • There is no automatic method for aligning a main and secondary axis, it is required that you set the Min and Max in order to align them manually. The generic algorithm used to find these values is the following:

    Axis.Min = OtherAxis.Min/(OtherAxis.Max / Axis.Max)

  • See Also:
    Chart.getAxis(int), setPosition(int), setSeparation(int), Chart

    pixelToValue

    public double pixelToValue(int xyPixel)

    Converts a position in pixels in the chart area to its value representation on the selected axis.

    Remarks:
  • The origin or (0,0) coordinate in pixels, is always positioned in the top/left corner of the chart, without including the toolbar or other tools that may be showing in the chart area.

  • When customizing the chart painting or positioning annotation objects in the chart area. You may want to convert a particular position in pixels to axis coordinates. Therefore, this method is particularly useful for this purpose.

  • The valueToPixel(double) method provides the opposite result, converting chart axis value to pixel coordinates in the chart.

  • All mouse events return event arguments that hold the X and Y pixel values where the mouse event was fired in the chart area. By converting the pixels you can determine the point value where the user clicked. Chart FX for Java only supports Client-Side Mouse events when generating charts as objects (Active Charts).

  • Parameters:
    xyPixel - An integer specifying the pixel value to be converted.
    See Also:
    Chart.getAxisX(), Chart.getAxisY(), valueToPixel(double), Chart

    resetScale

    public void resetScale()

    Prepares the selected axis to receive new data by resetting scale values.

    Remarks:
  • This method was formerly the ResetMaxMin enumeration of the Chart.openData(int, int, int) method.

  • This method is to be called before new data is going to be send to the chart.

  • This method resets all scale values for the selected axis so new when new data is set Chart FX can recalculate values accordingly.

    The affected scale values are:

    setMin(double) and setMax(double) which are set to undefined so when new data arrives they can be calculated accordingly by Chart FX.

    setStep(double) and setMinorStep(double) which are set to Automatic.

  • This method should be called before sending new data to the chart. Calling this method after setting the data to the chart will cause undesired results. Please refer to the Chart.recalcScale() method to recalculate automatic values for existent data.

  • See Also:
    setMax(double), setMin(double), setStep(double), setMinorStep(double), Chart.openData(int, int, int), Chart.closeData(int), Chart.recalcScale(), Chart

    setAlternateColor

    public void setAlternateColor(java.awt.Color value)

    Gets or sets the AlternateColor for a selected Axis or AxisSection object.

    Remarks:
  • The AlternateColor is used when the selected axis is configured as setInterlaced(boolean). The other color is defined by the configured Chart.setInsideColor(java.awt.Color).

  • The AxisSection.setTextColor(java.awt.Color) property is used to control the color for the text of the selected Axis or AxisSection object.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • Here is an example of an Interlaced Y axis:

  • See Also:
    setInterlaced(boolean), AxisSection.setTextColor(java.awt.Color), getSections(), Chart.setInsideColor(java.awt.Color), Axis, AxisSection

    setAutoScale

    public void setAutoScale(boolean value)

    Instructs Chart FX to always recalculate the specified Axis scale values (Min, Max) when new values are set to the chart.

    Remarks:
  • If you set a Min or Max value and new data is received by the chart when the AutoScale property is enabled, the scale values will be overwritten by Chart FX. This method will not affect the Step property if it has previously set to a specific value. If you want the AutoScale property to recalculate the setStep(double) value, make sure the Step property is set to zero (0).

  • The Chart.recalcScale() method is used to instruct a chart to recaculate. When called, the chart is re-scaled.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), setMin(double), setMax(double), setStep(double), setMinorStep(double), Chart.recalcScale(), Chart

    setCustomSteps

    public void setCustomSteps(double[] steps)

    Gets or sets a custom step for the selected axis.

    Remarks:
  • The CustomSteps property holds an array of numbers (double) that specifies the custom step for a selected axis.

  • The step applied to the axis will begin to cycle if your chart contains more points than values specifed in the CustomStep assignment. For example, if you set the CustomStep to (5,10,20,30) the axis step would look like:

    0,5,15,35,65,70,80,100,130,135,...

  • See Also:
    setStep(double), setMinorStep(double), Chart.getAxisX(), Chart.getAxisY(), Chart

    setFirstLabel

    public void setFirstLabel(int value)

    Gets or sets a value used to customize the first label displayed on a selected axis.

    Remarks:
  • The setting must be an integer specifying where you want labels to begin. The axis will then follow the setStep(double) associated with it to display subsequent labels.

  • When you set a value for this property, the AutoFirstLabel value of the Axis.Style is overwritten to the value you specify.

  • When using this property in the X Axis of a chart with values ranging from 0 to 1, the axis' setMinorStep(double) is used to calculate which label is the first, second, third, etc. When X Axis values range >1, then the axis' setStep(double) is used for this calculation.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), getLabel(int), getKeyLabel(int), setStep(double), setMinorStep(double), Chart

    setFont

    public void setFont(java.awt.Font value)

    Allows you to change the label Font attributes of the selected axis.

    Remarks:
  • The Font property is used to change the font settings for the labels in the selected axis, if you're trying to change the font settings for the axis title, please refer to the Title.setFont(java.awt.Font) member of the Title object.

  • When setting a font in Chart FX, you should create a new font object with the desired attributes. Then assign that object to the desired chart element.

  • For more information regarding the Font type, please refer to the Java API Documentation.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), Title.setFont(java.awt.Font), Title

    setForceZero

    public void setForceZero(boolean value)

    Gets or sets a value indicating whether or not to start an axis mininum value at zero.

    Remarks:
  • By default, Chart FX will set the minimum value of a numerical axis to zero even if the data set starts at a greater value. If you want Chart FX to automatically set the minimum value of the axis to the minimum value in the data passed, set this property to FALSE.

  • This property can also be controlled by the setStyle(int) member and the AS_FORCEZERO flag.

  • This property can also be controlled by the setStyle(int) member and the AS_FORCE_ZERO flag.

  • This property applies to numerical axes only.

  • See Also:
    setStyle(int), Axis

    setGridlines

    public void setGridlines(boolean value)

    Gets or sets a value indicating to show gridlines for the selected Axis or AxisSection object.

    Remarks:
  • The AxisSection.getGrid() member returns a Line object which may be customized using the supported Line class members.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • See Also:
    AxisSection.getGrid(), getSections(), AxisSection, Axis

    setInterlaced

    public void setInterlaced(boolean value)

    Creates a grid of alternating colors for a selected axis to improve chart readability.

    Remarks:
  • When set to True, a grid with alternating colors is created for the selected axis. This visual attribute helps end users distinguish the different value ranges in the chart and easily recognize the value for a particular point.

  • Use the AxisSection.setAlternateColor(java.awt.Color) and Chart.setInsideColor(java.awt.Color) members to set the Interlaced colors.

  • If you use this property for both the X and Y axes, the results show overlapping interlaced grids.

  • Here is an example of an Interlaced grid on the Y axis:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), AxisSection.getGrid(), DataEditor.setInterlaced(int), Chart.getAxis(int), Chart, DataEditor

    setInverted

    public void setInverted(boolean value)

    Gets or sets a value specifying if a selected numerical axis max value is lesser than the min value.

    Remarks:
  • For an axis to be inverted using this property, the setting must be applied before Chart FX calculates the scale for the axis. For example before the CloseData or RecalcScale method calls.

  • This property should be applied to a numerical axis. Assignment to categorical axes will not have an effect.

  • This property can only be applied to the X Axis in an XY plot chart. In an XY plot, the X Axis is a numerical axis rather than categorical.

  • When a selected axis is inverted, the alignment of the categorical axis of the chart will be reversed to make the chart more readable.

  • See Also:
    setMax(double), setMin(double), Chart.getAxisY(), Chart.getAxisX(), Chart.recalcScale(), Chart.closeData(int), Chart

    setKeyLabel

    public void setKeyLabel(int i,
                            java.lang.String value)
    Deprecated. You should use getKeyLabel() instead.

    See Also:
    LabelList

    setLabel

    public void setLabel(int i,
                         java.lang.String value)
    Deprecated. You should use getLabel() instead.

    See Also:
    LabelList

    setLabelAngle

    public void setLabelAngle(short value)

    Sets the text rotation for the labels in the selected axis.

    Remarks:
  • This property accepts an integer (representing degrees) ranging from [-90,90], specifying the rotation angle desired. Set this property to 90 to show labels vertically.

  • In order to set this property you must make sure the font type associated with the axis is a True Type Font.

  • Use a positive number to rotate the labels from lower left to upper right. Use negative degrees to rotate text from upper left to lower right.

  • If you would like to change the angle of PointLabels, you can use the Chart.setPointLabelAngle(short) member of the Chart object.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), getLabel(int), setStyle(int), Chart.setPointLabelAngle(short), Chart.getAxis(int), Chart

    setLabelValue

    public void setLabelValue(double value)

    Allows you to set associate text labels to major tick marks in a numerical axis.

    This property can get or set the LabelValue assigned to any of the axes.

    Remarks:
  • Normally, labels in a numerical axis are automatically controlled and displayed according to the setMin(double), setMax(double) and setStep(double) members. In some cases, you'll need to associate text labels with a numerical axis (using the getLabel(int) property), but when any of the scale values (Min, Max, Step, etc) change, these labels will no longer serve their purpose as the tick marks will be recalculated according to scale settings.

  • For example, if you have a chart where the Y axis ranges from Min=0 to Max=100 and Step=25, you'll have 4 tick marks on 25,50,75 and 100. By default Chart FX will display numbers (as labels) associated with each tick mark.

    Now let's say you want to associate text labels (instead of the number) with each tick mark in the Y axis and you use the Label Property to set the following text labels: "Twenty-Five", "Fifty", "Seventy-Five", "One Hundred".

    When you do this, everything will work out fine and the 4 tick marks will be labeled accordingly. However, if during the execution of your program or through user interaction, the Step suddenly changes from 25 to 12.5, you'll have 8 tick marks instead of 4 and because you used the Label property with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.

    If you would have set the LabelValue Property to 25, when the Step changes from 25 to 12.5 Chart FX will label every other tick mark and the labels will correspond to their initial setting.

  • Label visual attributes like rotation, color and font are also accessible through the setLabelAngle(short), AxisSection.setTextColor(java.awt.Color), and setFont(java.awt.Font) members, respectively.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), setStep(double), getLabel(int), setLabelAngle(short), AxisSection.setTextColor(java.awt.Color), setFont(java.awt.Font), Chart

    setLogBase

    public void setLogBase(double value)

    Used to set a logarithmic scale for a numerical axis and recalculate the values as powers equal to the setting of this property.

    Remarks:
  • The LogBase property can be applied only to a numerical axis, a categorical axis will ignore this setting.

  • The LogBase property is a member of the axis object, therefore the axis object must be referenced in order to properly access the LogBase property.

  • No zeros or negative data values are permitted in logarithmic charts.

  • The setStep(double) and setMinorStep(double) configurations must be equal or greater than the LogBase property setting.

  • Resetting the data contained in a chart will not automatically recalculate axis values, unless the Chart.recalcScale() method is called.

  • The LogBase has been set to 10 in the following bar chart:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMin(double), setMax(double), setStep(double), setMinorStep(double), Chart.recalcScale(), Chart

    setMax

    public void setMax(double value)

    Defines the maximum value of a specific axis.

    Gets or sets the Max value assigned to the specified axis.

    Remarks:
  • The Max property can be applied only to a numerical axis, a categorical axis will ignore this setting.

  • The Max property is a member of the axis object, therefore the axis object must be referenced in order to properly access the Max property.

  • If no Max value is specified, Chart FX will automatically set a maximum value according to the data provided, you can use this property to read or write this default value.

  • Resetting the data contained in a chart will not automatically set a new Max value unless the Chart.recalcScale() method is called or the setAutoScale(boolean) member is set to True.

  • The value of the Max property must be greater than the value of the Min property.

  • There is no automatic method for aligning a main and secondary axis, it is required that you set the Min and Max in order to align them manually. The generic algorithm used to find these values is the following:

    Axis.Min = OtherAxis.Min/(OtherAxis.Max / Axis.Max)

  • See Also:
    setAutoScale(boolean), Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMin(double), Chart.recalcScale(), Chart

    setMin

    public void setMin(double value)

    Defines the minimum value of a selected axis.

    Gets or sets the Min value assigned to the specified axis.

    Remarks:
  • The Min property can be applied only to a numerical axis, a categorical axis will ignore this setting.

  • The Min property is a member of the axis object, therefore the axis object must be referenced in order to properly access the Min property.

  • If no Min value is specified, Chart FX will automatically set a minimum value according to the data provided, you can use this property to read or write this default value.

  • Changing the data contained in a chart will not automatically set a new Min value unless the Chart.recalcScale() method is called or the setAutoScale(boolean) member is set to True.

  • The value of the Min property must be lesser than the value of the Max property.

  • There is no automatic method for aligning a main and secondary axis, it is required that you set the Min and Max in order to align them manually. The generic algorithm used to find these values is the following:

    Axis.Min = OtherAxis.Min/(OtherAxis.Max / Axis.Max)

  • See Also:
    setAutoScale(boolean), Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMax(double), Chart.recalcScale(), Chart

    setMinorGridlines

    public void setMinorGridlines(boolean value)

    Gets or sets a value indicating whether to show or hide minor gridlines.

    Remarks:
  • The minor interval is controlled by the setMinorStep(double) member, which must be set in order to use the MinorGrid. You can control the major interval using the setStep(double) member.

  • The AxisSection.getMinorGrid() member returns a Line object which may be customized using the supported Line class members.

  • You can use the AxisSection.setGridlines(boolean) and AxisSection.getGrid() members to configure the major grids for a chart.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • Below the MinorGrid (LightBlue) has been set to True, and the setMinorStep(double) member was set to 1.5:

  • See Also:
    AxisSection.getMinorGrid(), getSections(), Axis, AxisSection

    setMinorStep

    public void setMinorStep(double value)

    Specifies the increment you want between minor tick marks and minor gridlines (if they are displayed) on the selected axis.

    Remarks:
  • This property is used to control the interval of minor tick marks and gridlines in the selected axis. For example, if the selected axis ranges from 0-100 and you have specified a setStep(double) value of 10, labels and gridlines will appear at 10, 20, 30, etc. If you would like to have 5 minor tick marks in each major interval, set the MinorStep to 2. Please note the values for the Step and MinorStep properties are data related.

  • Labels will not appear at minor tick marks.

  • The value of the MinorStep property must be lesser than the value of the setStep(double) member.

  • When using the setFirstLabel(int) member in the X Axis of a chart with values ranging from 0 to 1, the axis' MinorStep is used to calculate which label is the first, second, third, etc. When X Axis values range >1, then the axis' setStep(double) is used for this calculation.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), AxisSection.getMinorGrid(), setAutoScale(boolean), AxisSection.setMinorTickMark(int), setStep(double), setFirstLabel(int), Chart.recalcScale(), Chart

    setMinorTickMark

    public void setMinorTickMark(int value)

    Gets or sets the style for the minor tick marks of an Axis or AxisSection object.

    Values:
    TickMark : Define the different ways of displaying tick marks at the major and minor gridlines on the selected axis.
    ValueDescription
    NONEHides tick marks for the selected axis.
    OUTSIDEDisplays tick marks on the outside of the selected axis.
    INSIDEDisplays tick marks on the inside of the selected axis.
    CROSSDisplays tick marks that cross inside and outside the selected axis.

    Remarks:
  • This property applies only to the minor gridlines, for the major gridlines please refer to the AxisSection.setTickMark(int) member.

  • The tick mark is not the gridline that crosses the entire chart, it is just a reference line that appears on every tick of the minor unit of the axis. If you want to display a gridline that crosses the chart, please refer to the AxisSection.setMinorGridlines(boolean) member.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection class members.

  • See Also:
    AxisSection.setTickMark(int), AxisSection.getMinorGrid(), getSections(), Axis

    setNotify

    public void setNotify(boolean value)

    Used to enable or disable the GetAxisLabel event so you can customize labels on the specified axis.

    Remarks:
  • This property can also be controlled by the setStyle(int) member and the Notify flag.

  • Chart FX for Java only supports the GetAxisLabel event when generating charts as .NET client controls and using client side chart events.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setStyle(int), Chart

    setPane

    public void setPane(int value)

    Gets or sets an integer value specifying the Pane for an Axis object.

    Remarks:
  • Additional axes may be assigned to panes in a chart. Once an axis object is assigned to a pane, that pane will be visible in the chart area. Data also associated with the selected axis will also be applied to the configured pane.

  • Use the Chart.getPanes() member to customize that attributes for a selected pane. This property exposes all the supported members of the Pane class.

  • See Also:
    Chart.getPanes(), Chart, Pane

    setPixPerUnit

    public void setPixPerUnit(double value)

    Gives you the ability to control how many pixels per unit are in a selected axis.

    This property is very useful if you want a scroll bar in the selected axis.

    Remarks:
  • If the Chart.setScrollable(boolean) member is set to False, the PixPerUnit will not have any effect on the axis. So make sure the Scrollable property is set to True when using the PixPerUnit property.

  • In the following chart, the X axis PixPerUnit has been set to 60:

    Chart.setScrollable(boolean)Chart.setScrollable(boolean)Chart.setScrollable(boolean)Chart.setScrollable(boolean)

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), setStep(double), Chart.setScrollable(boolean), setScrollView(double, double), Chart

    setPosition

    public void setPosition(int value)

    Specifies the placement of the axis labels and tick marks relative to the chart.

    Values:
    AxisPosition : Specifies the placement of the axis line relative to the chart.
    ValueDescription
    NEARSpecifies the axis line be placed near the chart in the following way: In a X axis, the axis line be below the chart. In Y axis, the axis line be left to the chart.
    CENTERSpecifies that axis line placed in the center of the chart.
    FARSpecifies that axis line is placed far from the chart in the following way: In a X axis, the axis line be above the chart. In a Y axis, the axis line is right to the chart.

    Remarks:
  • The Position property is a member of the axis object, therefore the axis object must be referenced in order to set the property correctly.

  • Multiple axes may be created using the Chart.getAxis(int) member of the chart object.

  • Both X and Y axes have been set to the AxisPosition.FAR position to switch their default locations:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), getLabel(int), AxisSection.setTickMark(int), Chart

    setScaleUnit

    public void setScaleUnit(double value)

    Gets or sets the scale unit of a selected axis.

    Remarks:
  • This property is useful when values passed to chart are large (i.e. 10,000,000). By configuring a reasonable scale unit, charts become easier to read and analyze.

  • The ScaleUnit property is a member of the axis object, therefore the axis object must be referenced in order to set the property correctly.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMax(double), setMin(double), Chart.recalcScale(), Chart

    setScrollPosition

    public void setScrollPosition(int value)

    Gets or sets the starting scroll position when a chart is scrollable.

    Remarks:
  • Whenever applying any scroll attributes to a chart, the chart should be configured as scrollable using the Chart.setScrollable(boolean) member.

  • When setting the ScrollPosition, the specified point will be the first point point included in the chart.

  • The getScrollSize() member is used to read the total number of scrolls in the chart based on the current scroll range.

  • You can set the scroll range using the setScrollView(double, double) method.

  • See Also:
    getScrollSize(), setScrollView(double, double), Chart

    setScrollView

    public void setScrollView(double min,
                              double max)

    Calculates the appropriate PixPerUnit and related scale values to create a scroll bar to view a portion of the selected axis.

    Remarks:
  • Sometimes is difficult to calculate the appropriate PixPerUnit value to create a view of a specific axis. This method allows you to set a min (starting point) and a max (ending point) that Chart FX will use to calculate the PixPerUnit and display the view.

  • When applied to a categorical axis (e.g. X Axis) the Min and Max are integer numbers that range from 1 to the number of points you have in the axis. If you want to create a view (scroll bar) with 10 points per view and start at point 20, the settings for the Min should be 20 and the Max setting is 30

  • When applied to a numerical axis (e.g. Y Axis), you should set the Min and Max according to the scale values of the axis. For example, if your axis ranges between 0 and 1 you may set a view with a Min=0.3 and Max=0.6

  • To destroy the view you can set the Min and Max to 0.

  • The GetScrollViewMin and GetScrollViewMax members may be used to obtain the current scroll view (min and max) for a selected axis.

  • Parameters:
    min - Where the view (scroll bar) begins.
    max - Where the view (scroll bar) ends.
    See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setPixPerUnit(double), Chart

    setSeparation

    public void setSeparation(int value)

    Gets or sets a gap value (in pixels) between multiple axis.

    Remarks:
  • This property is useful when multiple axes are configured and you need to create space for readability.

  • See Also:
    Chart.getAxis(int), Chart.getAxisX(), Chart.getAxisY(), Chart

    setStaggered

    public void setStaggered(boolean value)

    Alternates the level of the axis labels for the selected axis labels.

    Remarks:
  • Staggering axis labels can help improve chart readability when axis label strings are long.

  • You can also set staggered axis labels by using the setStyle(int) member with the SHOW_2LEVELS flag.

  • See Also:
    setStyle(int)

    setStep

    public void setStep(double value)

    Specifies the interval of major tick marks and gridlines on the selected axis.

    It also controls the gap or interval between labels in the selected axis.

    Remarks:
  • Normally, you use this property to control the interval of labels, tick marks and gridlines in the selected axis. For example, if the selected axis ranges from 0 -100 and you want to show labels, tick marks or gridlines every 10 units the appropriate setting for the Step property is 10.

  • This property can also be used for a categorical axis. For example, if your X axis displays labels ranging from January to December and you set the Step property to 2, then the categorical axis will display legends every other month.

  • You can also control a minor interval with the setMinorStep(double) member.

  • If no Step value is specified, Chart FX will automatically set a Step according to the data provided, you can use this property to read or write this default value.

  • Changing the data contained in a chart will not automatically change the Step value. If you want Chart FX to calculate an appropriate Step value automatically set the Step value to 0 (Automatic) or invoke the Chart.recalcScale() method.

  • The value of the Step property must be greater than the value of the setMinorStep(double) member.

  • In the example below, the Step for the Y axis has been set to 50. Notice the tick marks on the Y axis increase by 50:

  • When using the setFirstLabel(int) member in the X Axis of a chart with values ranging from 0 to 1, the axis' setMinorStep(double) is used to calculate which label is the first, second, third, etc. When X Axis values range >1, then the axis' Step is used for this calculation.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), AxisSection.getGrid(), setAutoScale(boolean), AxisSection.setTickMark(int), setMinorStep(double), setFirstLabel(int), Chart.recalcScale(), Chart

    setStyle

    public void setStyle(int value)

    Allows you to add additional styles to the selected axis.

    Values:
    AxisStyle : Define valid Styles for the axis
    ValueDescription
    HIDE_TEXTHides labels for the selected axis.
    NOTIFYSetting this flag will make the chart generate a GetAxisLabel Event every time it needs to draw a legend in the selected axis.
    SHOW_2_LEVELSDisplays staggered labels.
    SINGLE_LINEDo not word-wrap labels.
    BREAK_ZEROThis constant will cause a chart to set the starting point at zero. For example, if you have a bar chart with a minimum value of -50 and turn on this flag the starting point will be zero and you will have bars that go up or down, depending on their value.
    HIDEHides entire axis, including labels and tick marks.
    NOT_CLIPPEDDo not clip the X legends (It is the programmers responsibility to assure that labels don't overlap each other). Setting this flag ON will avoid the RED tags to show when a label is too big, you can also use this flag when you don't want to set labels for every point (i.e. set a label every 20th point).
    INTERLACEDDisplays Interlaced Grid on the selected axis.
    CENTEREDMoves tick mark so that labels are centered between major tick marks.
    ROTATE_TEXTThis setting applies to 3D charts only and it allows the text to be rotated when the chart is rotated.
    LONG_TICKDisplays a long major tick mark that makes the axis label appear enclosed in a box. This setting is used in conjunction with the Centered flag.
    AUTO_SCALESame as AutoScale Property.
    FORCE_ZEROForces minimum to zero when adjusting the axis in a chart where all values are positive.
    DEFAULTThe default value is: SingleLine OR BreakZero OR LongTick OR AutoScale OR ForceZero
    SHOW_ENDSForces ChartFX to display the minimum and maximum value independently from the step set to the chart. For example, if step is 10 and maximum is 95 when this setting is used, the axis will show ...60,70,80,90 and 95.
    NO_ROUND_STEPDo not round the interval of tick marks and gridlines on the selected axis. The values shown on the axis will exactly the same data passed to the chart.
    IGNORE_LABELSIgnores any axis label assignments and displays labels as default.
    GRID_FRONTPaints the axis gridlines on top of the series point markers.
    INVERTEDSets the Max value for the selected axis lesser than the Min value.
    DETECT_AREAInstructs Chart FX to include the area around the axis labels when accessing the axis context menu. By default the menu is only accessible by right-clicking over an axis label.
    SHOW_INTERMEDIATE_LOG_LABELSUsed to display incremental values for charts with logarithmic scale.
    AUTO_MINOR_STEPInstructs Chart FX to calculate the MinorStep automatically.
    AUTO_FIRST_LABELAutomatically positions the first label to the closest number rounded to the axis step.
    AUTO_CENTERInstructs Chart FX to center the labels automatically.
    FIX_RIGHT_ALIGNEDRight justifies label text.

    Remarks:
  • This property is a mask property. This means all settings represent a bit in the word that you need to turn on or off according to what you want. For this purpose you will need to use the bitwise operators (And, Or, Not, Xor) provided by your development tool.

  • Because it is a mask property, you must make sure you use these operators to turn on/off bits and avoid losing previous settings to the property.

    For example, if you want to turn ON the Interlaced setting the right way of setting this property is:

    chart1.getAxisX().setStyle(chart1.getAxisX().getStyle() | AxisStyle.INTERLACED);

    If you type the following code:

    chart1.getAxisX().setStyle(AxisStyle.INTERLACED);
    (WRONG!)

    You will erase all other settings in the property causing an erratic behavior of the library and an incorrect setting of the individual properties which also control these flags.

  • The Axis.Style property supports a flag called AutoFirstLabel (Default=ON) which automatically positions the first label to the closest number rounded to the axis step. For example, if a numeric axis starts at 7 with a Step of 10 and the AutoFirstLabel property is ON, the axis will show labels at 10,20,30 and so on. If the AutoFirstLabel property is turned off labels will be shown at 7,17,27 and so on.

    Note: If the axis contains dates (Date Axis) the AutoFirstLabel property will position the first label at the end of the month. If the AutoFirstLabel is turned OFF, the labels will be shown using the first avaialble date and advanced using the Step property setting.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), setMax(double), setMin(double), getLabel(int), Chart.recalcScale(), Chart

    setTextColor

    public void setTextColor(java.awt.Color value)

    Gets or sets the color for text of a selected Axis or AxisSection object.

    Remarks:
  • The TextColor member is used to set a color for the specified Axis or AxisSection labels. Please refer to the TextColor property of the Title object to customize the color for the axis title.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection and class members.

  • For more information regarding the Color type, please refer to your development environment documentation.

  • See Also:
    getSections(), Axis, AxisSection

    setTickMark

    public void setTickMark(int value)

    Gets or sets the style for the tick marks of an Axis or AxisSection object.

    Values:
    TickMark : Define the different ways of displaying tick marks at the major and minor gridlines on the selected axis.
    ValueDescription
    NONEHides tick marks for the selected axis.
    OUTSIDEDisplays tick marks on the outside of the selected axis.
    INSIDEDisplays tick marks on the inside of the selected axis.
    CROSSDisplays tick marks that cross inside and outside the selected axis.

    Remarks:
  • This property applies only to the major gridlines, for the minor gridlines please refer to the AxisSection.setMinorTickMark(int) member.

  • The tick mark is not the gridline that crosses the entire chart, it is just a reference line that appears on every tick of the minor unit of the axis. If you want to display a gridline that crosses the chart, please refer to the AxisSection.setGridlines(boolean) member.

  • The getSections() member returns an AxisSection object which may be configured using the AxisSection and class members.

  • The major unit is controlled by the setStep(double) member.

  • See Also:
    AxisSection.setMinorTickMark(int), AxisSection.setGridlines(boolean), getSections(), setStep(double), Axis, AxisSection

    setTitle

    public void setTitle(Title value)

    Gets or sets the title object for a specific axis.

    Remarks:
  • The Title property is a member of the axis object; therefore, the axis object must be referenced in order to properly utilize the Title property.

  • This property receives or returns a Title class. Accessing the title object properties you will be able to change attributes like: Alignment, Color, Font,Text, etc.

  • This property is used to get or set title objects for the the axis. To set the chart top title, please refer to the chart object Chart.getTitles() property.

  • You can create a multiple line title by including a new line character inside the title string.

  • Below is a chart with both X and Y Axis titles:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Title.setText(java.lang.String), Chart.getAxis(int), Chart, Title

    setVisible

    public void setVisible(boolean value)

    Shows or hides the lines, labels, tick marks and grids for the selected axis.

    Remarks:
  • The Visible property is a member of the axis object; therefore, the axis object must be referenced in order to properly utilize the Visible property.

  • By hiding the labels for the specified axis using the Visible property, other attributes such as the AxisSection.getGrid() and tick marks are also hidden.

  • The X axis has been hidden in the chart below:

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.getAxis(int), Chart

    setYAxis

    public void setYAxis(boolean value)

    Used to set the orientation (X or Y) for a newly created axis.

    Remarks:
  • When you create a new axis using the Axis property, you may assign the axis as an X or Y axis. When YAxis is set to True, the new axis will be a vertical Y axis. When YAxis is set to False, the new axis will be a horizontal X axis.

  • The setPosition(int) member allows you to position an axis Near or Far.

  • You can use the setSeparation(int) member to modify the gap between axes.

  • There is no automatic method for aligning a main and secondary axis, it is required that you set the Min and Max in order to align them manually. The generic algorithm used to find these values is the following:

    Axis.Min = OtherAxis.Min/(OtherAxis.Max / Axis.Max)

  • See Also:
    Chart.getAxis(int), setPosition(int), setSeparation(int), Chart

    valueToPixel

    public int valueToPixel(double dValue)

    Converts a logical chart value to its position in pixels for a selected axis.

    Remarks:
  • When customizing the chart painting or positioning annotation objects in the chart area. You may want to convert a particular position in the chart area given in axis units to screen coordinates (pixels). Therefore, this method is particularly useful for this purpose.

  • The pixelToValue(int) method provides the opposite result, converting screen coordinates to axis values in the chart.

  • Parameters:
    dValue - A double specifying the point value to be converted.
    See Also:
    Chart.getAxisX(), Chart.getAxisY(), pixelToValue(int), Chart

    zoom

    public void zoom(double min,
                     double max)

    Allows you to specify a min and max zoom value for a selected axis.

    Remarks:
  • You may turn the zoom off using the zoomOff() method of the Axis Object.

  • If the Chart.setZoom(boolean) member of the Chart object is configured to False, all Axis specific zooms will be turned off.

  • Parameters:
    min - Starting point of the zoom range.
    max - Ending point of the zoom range.
    See Also:
    Chart.getAxisX(), Chart.getAxis(int), Chart.getAxis(int), Chart.setZoom(boolean), zoomOff(), Chart

    zoomOff

    public void zoomOff()

    Allows you to ignore any zoom attributes set using the Zoom method and return to the default axis view.

    Remarks:
  • Use the zoom(double, double) method to set a zoom for a specified range on a selected axis.

  • If the Chart.setZoom(boolean) member of the Chart object is configured to False, all Axis specific zooms will be turned off.

  • See Also:
    Chart.getAxisX(), Chart.getAxisY(), Chart.setZoom(boolean), zoom(double, double), Chart

    http://www.softwarefx.com

    2005 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.