public class AxisScale
extends java.lang.Object
This class is used to handle the visible axis Scales of a chart.
When zooming or scrolling in the chart the visible axis scales values changes reflecting the current max and min values.
Constructor and Description |
---|
AxisScale() |
Modifier and Type | Method and Description |
---|---|
Axis |
getAxis()
Description goes here
|
double[] |
getCustomSteps()
Allows you to set a custom step for the selected scale.
|
int |
getFirstLabel()
Gets or sets a value used to customize the first label displayed on a selected scale.
|
DataUnit |
getFrom()
Gets or sets the From value assigned to the specified axis scale
|
java.util.Date |
getFromDateTime()
Gets or sets the From value assigned to the specified axis scale
|
double |
getFromDouble()
Gets or sets the From value assigned to the specified axis scale
|
TimeSpan |
getFromTimeSpan()
Gets or sets the From value assigned to the specified axis scale
|
DataUnit |
getLabelValue()
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
java.util.Date |
getLabelValueDateTime()
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
double |
getLabelValueDouble()
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
TimeSpan |
getLabelValueTimeSpan()
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
DataUnit |
getMinorStep()
Description goes here
|
java.util.Date |
getMinorStepDateTime()
Description goes here
|
double |
getMinorStepDouble()
Description goes here
|
TimeSpan |
getMinorStepTimeSpan()
Description goes here
|
double |
getProportion()
Specifies the value to divide the AxisScale
|
double |
getScaleUnit()
Returns the scale unit of a selected scale.
|
DataUnit |
getStep()
Specifies the interval of major tick marks and gridlines on the selected scale.
|
java.util.Date |
getStepDateTime()
Specifies the interval of major tick marks and gridlines on the selected scale.
|
double |
getStepDouble()
Specifies the interval of major tick marks and gridlines on the selected scale.
|
TimeSpan |
getStepTimeSpan()
Specifies the interval of major tick marks and gridlines on the selected scale.
|
DataUnit |
getTo()
Gets or sets the To value assigned to the specified axis scale.
|
java.util.Date |
getToDateTime()
Gets or sets the To value assigned to the specified axis scale.
|
double |
getToDouble()
Gets or sets the To value assigned to the specified axis scale.
|
TimeSpan |
getToTimeSpan()
Gets or sets the To value assigned to the specified axis scale.
|
boolean |
isAutoMinorStep()
Specifies if the increment between minor tick marks and minor gridlines was automatically calculated.
|
boolean |
isAutoStep()
Specifies if the the interval of major tick marks and gridlines on the selected scale was automatically calculated.
|
void |
resetCustomSteps()
Set the property CustomSteps to its default value.
|
void |
resetFirstLabel()
Set the property FirstLabel to its default value.
|
void |
resetFrom()
Set the property From to its default value.
|
void |
resetLabelValue()
Set the property LabelValue to its default value.
|
void |
resetMinorStep()
Set the property MinorStep to its default value.
|
void |
resetProportion()
Set the property Proportion to its default value.
|
void |
resetScaleUnit()
Set the property ScaleUnit to its default value.
|
void |
resetStep()
Set the property Step to its default value.
|
void |
resetTo()
Set the property To to its default value.
|
void |
setCustomSteps(double[] value)
Allows you to set a custom step for the selected scale.
|
void |
setFirstLabel(int value)
Gets or sets a value used to customize the first label displayed on a selected scale.
|
void |
setFrom(DataUnit value)
Gets or sets the From value assigned to the specified axis scale
|
void |
setFrom(java.util.Date value)
Gets or sets the From value assigned to the specified axis scale
|
void |
setFrom(double value)
Gets or sets the From value assigned to the specified axis scale
|
void |
setFrom(TimeSpan value)
Gets or sets the From value assigned to the specified axis scale
|
void |
setLabelValue(DataUnit value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
void |
setLabelValue(java.util.Date value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
void |
setLabelValue(double value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
void |
setLabelValue(TimeSpan value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale.
|
void |
setMinorStep(DataUnit value)
Description goes here
|
void |
setMinorStep(java.util.Date value)
Description goes here
|
void |
setMinorStep(double value)
Description goes here
|
void |
setMinorStep(TimeSpan value)
Description goes here
|
void |
setProportion(double value)
Specifies the value to divide the AxisScale
|
void |
setScaleUnit(double value)
Returns or Sets the scale unit of a selected scale.
|
void |
setStep(DataUnit value)
Specifies the interval of major tick marks and gridlines on the selected scale.
|
void |
setStep(java.util.Date value)
Specifies the interval of major tick marks and gridlines on the selected scale.
|
void |
setStep(double value)
Specifies the interval of major tick marks and gridlines on the selected scale.
|
void |
setStep(TimeSpan value)
Specifies the interval of major tick marks and gridlines on the selected scale.
|
void |
setTo(DataUnit value)
Gets or sets the To value assigned to the specified axis scale.
|
void |
setTo(java.util.Date value)
Gets or sets the To value assigned to the specified axis scale.
|
void |
setTo(double value)
Gets or sets the To value assigned to the specified axis scale.
|
void |
setTo(TimeSpan value)
Gets or sets the To value assigned to the specified axis scale.
|
public boolean isAutoMinorStep()
Specifies if the increment between minor tick marks and minor gridlines was automatically calculated.
boolean isAutoMinorStep; isAutoMinorStep = chart1.getAxisX().getScale().getIsAutoMinorStep();
public boolean isAutoStep()
Specifies if the the interval of major tick marks and gridlines on the selected scale was automatically calculated.
boolean isAutoStep; isAutoStep = chart1.getAxisX().getScale().getIsAutoStep();
public Axis getAxis()
public double[] getCustomSteps()
Allows you to set a custom step for the selected scale.
The setCustomSteps
method holds an array of numbers (double) that specifies a series of step values for the selected scale.
The step applied to the scale will begin to cycle if your chart contains enough points. For example, if you set the CustomStep to (5,10,20,30) the scale step would look like the following:
0,5,15,35,65,70,80,100,130,135,...
Below, the Y Axis custom step has been set to {250, 500, 1500, 3000}:
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
double[] myStep;
myStep = new double[] {250, 500, 1500, 3000};
chart1.getAxisY().setCustomSteps(myStep);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
resetCustomSteps
public void setCustomSteps(double[] value)
Allows you to set a custom step for the selected scale.
The setCustomSteps
method holds an array of numbers (double) that specifies a series of step values for the selected scale.
The step applied to the scale will begin to cycle if your chart contains enough points. For example, if you set the CustomStep to (5,10,20,30) the scale step would look like the following:
0,5,15,35,65,70,80,100,130,135,...
Below, the Y Axis custom step has been set to {250, 500, 1500, 3000}:
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
double[] myStep;
myStep = new double[] {250, 500, 1500, 3000};
chart1.getAxisY().setCustomSteps(myStep);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
value
- resetCustomSteps
public int getFirstLabel()
Gets or sets a value used to customize the first label displayed on a selected scale.
The setting must be an integer specifying where you want labels to begin. The scale will then follow the setStep
associated with it to display subsequent labels.
When using this method in the X Axis of a chart with values ranging from 0 to 1, the axis' setMinorStep
is used to calculate which label is the first, second, third, etc. When X Axis values range bigger than 1, then the axis setStep
is used for this calculation.
Below, the first label in the X-Axis is set to 3:
PopulateCarProduction(chart1); chart1.getTitles().add(new TitleDockable("Vehicles Production by Type")); chart1.getAxisX().setFirstLabel(3);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
resetFirstLabel
public void setFirstLabel(int value)
Gets or sets a value used to customize the first label displayed on a selected scale.
The setting must be an integer specifying where you want labels to begin. The scale will then follow the setStep
associated with it to display subsequent labels.
When using this method in the X Axis of a chart with values ranging from 0 to 1, the axis' setMinorStep
is used to calculate which label is the first, second, third, etc. When X Axis values range bigger than 1, then the axis setStep
is used for this calculation.
Below, the first label in the X-Axis is set to 3:
PopulateCarProduction(chart1); chart1.getTitles().add(new TitleDockable("Vehicles Production by Type")); chart1.getAxisX().setFirstLabel(3);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
value
- resetFirstLabel
public TimeSpan getFromTimeSpan()
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
resetFrom
public void setFrom(TimeSpan value)
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
value
- resetFrom
public DataUnit getFrom()
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
resetFrom
public void setFrom(DataUnit value)
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
value
- resetFrom
public double getFromDouble()
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
resetFrom
public void setFrom(double value)
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
value
- resetFrom
public java.util.Date getFromDateTime()
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
resetFrom
public void setFrom(java.util.Date value)
Gets or sets the From value assigned to the specified axis scale
The AxisScale setFrom
method can be applied to different axis types, so this method can be set to a categorical axis.
If no From value is specified, will automatically set a From value according to the data provided, you can use this method to read or write this default value.
The value of the setFrom
method must be smaller than the value of the To method.
To set the From value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setFrom(new DateTime(2006, 1, 15));
value
- resetFrom
public TimeSpan getLabelValueTimeSpan()
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
resetLabelValue
public void setLabelValue(TimeSpan value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
value
- resetLabelValue
public DataUnit getLabelValue()
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
resetLabelValue
public void setLabelValue(DataUnit value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
value
- resetLabelValue
public double getLabelValueDouble()
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
resetLabelValue
public void setLabelValue(double value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
value
- resetLabelValue
public java.util.Date getLabelValueDateTime()
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
resetLabelValue
public void setLabelValue(java.util.Date value)
Allows you to set and associate text labels to major tick marks in a numerical axis scale. This property can get or set the LabelValue assigned to any of the axes scales.
Normally, labels in a numerical axis scale are automatically controlled and displayed according to the setMin
, setMax
and setStep
methods. In some cases, you'll need to associate text labels with a numerical axis scale(using the setLabels
method), 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 scale 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 scale and you use the Label method 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 because you used the Label method with indexes 0,1,2 and 3, the "Fifty" tickmark will no longer correspond to the 50 value.
If you would have set the setLabelValueDateTime
method 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
, setTextColor
, and setFont
methods, respectively.
To set a LabelValue of 25 for the primary Y axis scale:
chart1.getAxisY().getScales().get(0).setLabelValue(25);
value
- resetLabelValue
public TimeSpan getMinorStepTimeSpan()
Description goes here
resetMinorStep
public void setMinorStep(TimeSpan value)
Description goes here
value
- resetMinorStep
public DataUnit getMinorStep()
Description goes here
resetMinorStep
public void setMinorStep(DataUnit value)
Description goes here
value
- resetMinorStep
public double getMinorStepDouble()
Description goes here
resetMinorStep
public void setMinorStep(double value)
Description goes here
value
- resetMinorStep
public java.util.Date getMinorStepDateTime()
Description goes here
resetMinorStep
public void setMinorStep(java.util.Date value)
Description goes here
value
- resetMinorStep
public double getProportion()
Specifies the value to divide the AxisScale
To show 2 numeric AxisScales in a 20/80 proportion:
LinearAxisScale linearAxisScale; linearAxisScale = new LinearAxisScale(); linearAxisScale.setFrom(0); linearAxisScale.setTo(10); linearAxisScale.setProportion(0.2); chart1.getAxisY().getScales().set(0, ((AxisScale)linearAxisScale)); linearAxisScale = new LinearAxisScale(); linearAxisScale.setFrom(11); linearAxisScale.setTo(50); linearAxisScale.setProportion(0.8); chart1.getAxisY().getScales().add(((AxisScale)linearAxisScale));
resetProportion
public void setProportion(double value)
Specifies the value to divide the AxisScale
To show 2 numeric AxisScales in a 20/80 proportion:
LinearAxisScale linearAxisScale; linearAxisScale = new LinearAxisScale(); linearAxisScale.setFrom(0); linearAxisScale.setTo(10); linearAxisScale.setProportion(0.2); chart1.getAxisY().getScales().set(0, ((AxisScale)linearAxisScale)); linearAxisScale = new LinearAxisScale(); linearAxisScale.setFrom(11); linearAxisScale.setTo(50); linearAxisScale.setProportion(0.8); chart1.getAxisY().getScales().add(((AxisScale)linearAxisScale));
value
- resetProportion
public double getScaleUnit()
Returns the scale unit of a selected scale.
This constant is very useful when the values used on the Y axis are too big (e.g. 10,000,000) in this case you can use a 1,000,000 scale and the values on the Y axis will be divided by this scale.
The setScaleUnit
method is a member of the scale object; therefore, the scale object must be referenced in order to set the method correctly.
To set the Scale Unit of the primary Y scale to 1000:
chart1.getAxisY().getScales().get(0).setScaleUnit(1000);
resetScaleUnit
public void setScaleUnit(double value)
Returns or Sets the scale unit of a selected scale.
This constant is very useful when the values used on the Y axis are too big (e.g. 10,000,000) in this case you can use a 1,000,000 scale and the values on the Y axis will be divided by this scale.
The setScaleUnit
method is a member of the scale object; therefore, the scale object must be referenced in order to set the method correctly.
To set the Scale Unit of the primary Y scale to 1000:
chart1.getAxisY().getScales().get(0).setScaleUnit(1000);
value
- resetScaleUnit
public TimeSpan getStepTimeSpan()
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
resetStep
public void setStep(TimeSpan value)
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
value
- resetStep
public DataUnit getStep()
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
resetStep
public void setStep(DataUnit value)
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
value
- resetStep
public double getStepDouble()
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
resetStep
public void setStep(double value)
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
value
- resetStep
public java.util.Date getStepDateTime()
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
resetStep
public void setStep(java.util.Date value)
Specifies the interval of major tick marks and gridlines on the selected scale. It also controls the gap or interval between labels in the selected scale.
Normally, you use this method to control the interval of labels, tick marks and gridlines in the selected scale. For example, if the selected axis scale ranges from 0 to 100 and you want to show labels, tick marks or gridlines every 10 units, then the appropriate setting for the setStep
method is 10.
This method 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 setStep
method to 2, then the categorical axis will display legends every other month.
You can also control a minor interval with the MinorsetStep
method.
If no Step value is specified, will automatically set a Step according to the data provided, you can use this method to read or write this default value.
The value of the setStep
method must be greater than the value of the MinorsetStep
method.
To set the step on the major interval to 15 days in a Date categorical Axis:
chart1.getAxisX().getScale().setStep((15 * (DataUnit.Day)));
value
- resetStep
public TimeSpan getToTimeSpan()
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
resetTo
public void setTo(TimeSpan value)
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
value
- resetTo
public DataUnit getTo()
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
resetTo
public void setTo(DataUnit value)
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
value
- resetTo
public double getToDouble()
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
resetTo
public void setTo(double value)
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
value
- resetTo
public java.util.Date getToDateTime()
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
resetTo
public void setTo(java.util.Date value)
Gets or sets the To value assigned to the specified axis scale.
The AxisScale To method can be applied to different axis types, so this method can be set to a categorical axis.
If no To value is specified, will automatically set a To value according to the data provided, you can use this method to read or write this default value.
The value of the To method must be greater than the value of the From method.
To set the To value of the primary X axis scale to a datetime:
chart1.getAxisX().getScale().setTo(new DateTime(2013, 2, 28));
value
- resetTo
public void resetCustomSteps()
setCustomSteps
public void resetFirstLabel()
setFirstLabel
public void resetFrom()
setFrom
public void resetLabelValue()
setLabelValue
public void resetMinorStep()
setMinorStep
public void resetProportion()
setProportion
public void resetScaleUnit()
setScaleUnit
public void resetStep()
setStep
public void resetTo()
setTo
2014 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.