public final class DataValues
extends java.lang.Object
Provides access to the DataValues object which is the key component to pass data to the chart.
You can also assign x-values to create an XY Plot using the X method.
You can set initial values using the setYFrom
method. Used in conjunction with the Y method, you can create a 'floating bars' effect for bar charts.
Please note that instead of the value associated with the point, you can assign a hidden constant which will cause the point to be hidden in the chart. Although a hidden point is physically in the data array, when you use this constant the marker will not appear in the chart, and if you have charts like a line or area chart, the line will break at that particular point.
Constructor and Description |
---|
DataValues() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all the data values in the chart.
|
boolean |
commitChanges()
Finalizes chart data and invokes selected data related tasks.
|
void |
compact(DataUnit step)
Compacts the data in order to display more summarized information.
|
void |
compact(java.util.Date step)
Compacts the data in order to display more summarized information.
|
void |
compact(double step)
Compacts the data in order to display more summarized information.
|
void |
compact(TimeSpan step)
Compacts the data in order to display more summarized information.
|
DataUnit |
get(int series,
int point)
Provides access to the Y value for the specific series and point.
|
DataUnit |
getCompactedBy()
Gets or sets a value indicating the interval of units to compress data.
|
java.util.Date |
getCompactedByDateTime()
Gets or sets a value indicating the interval of units to compress data.
|
double |
getCompactedByDouble()
Gets or sets a value indicating the interval of units to compress data.
|
TimeSpan |
getCompactedByTimeSpan()
Gets or sets a value indicating the interval of units to compress data.
|
java.util.Date |
getDateTime(int series,
int point)
Provides access to the Y value for the specific series and point.
|
double |
getDouble(int series,
int point)
Provides access to the Y value for the specific series and point.
|
java.util.List<java.lang.String> |
getLabels()
Provides access to label collection of the main x-axis.
|
int |
getPoints()
Gets or sets a value indicating the number of series allocated for the chart.
|
int |
getSeries()
Gets or sets a value indicating the number of series allocated for the chart.
|
TimeSpan |
getTimeSpan(int series,
int point)
Provides access to the Y value for the specific series and point.
|
IDataArray |
getX()
Allows you to set X-Values for specific point of XY plots.
|
IDataArray |
getY()
Allows you to access the Y coordinates of the data points.
|
IDataArray |
getYFrom()
Allows you to set the starting Y-value for a specific value on the chart.
|
boolean |
isAggressiveAllocation()
Gets or sets a value indicating ChartFX should agreesively allocate space for future values.
|
boolean |
isCompacted()
Gets a value indicating whether or not the data is compacted.
|
boolean |
isInitializeHidden()
Gets or sets a value indicating to intialize all non-initialized values to hidden value.
|
boolean |
isInterpolateHidden()
Gets or sets a value specifying to draw a connecting line over a missing data point.
|
void |
recalculateScale()
Recalculates the scale of the chart based on the data available.
|
void |
removeSeries(int seriesIndex)
Remove a Series from the collection by index.
|
void |
resetCompactedBy()
Set the property CompactedBy to its default value.
|
void |
resetFlags()
Set the property Flags to its default value.
|
void |
set(int series,
int point,
DataUnit value)
Provides access to the Y value for the specific series and point.
|
void |
set(int series,
int point,
java.util.Date value)
Provides access to the Y value for the specific series and point.
|
void |
set(int series,
int point,
double value)
Provides access to the Y value for the specific series and point.
|
void |
set(int series,
int point,
TimeSpan value)
Provides access to the Y value for the specific series and point.
|
void |
setAggressiveAllocation(boolean value)
Gets or sets a value indicating ChartFX should agreesively allocate space for future values.
|
void |
setCompactedBy(DataUnit value)
Gets or sets a value indicating the interval of units to compress data.
|
void |
setCompactedBy(java.util.Date value)
Gets or sets a value indicating the interval of units to compress data.
|
void |
setCompactedBy(double value)
Gets or sets a value indicating the interval of units to compress data.
|
void |
setCompactedBy(TimeSpan value)
Gets or sets a value indicating the interval of units to compress data.
|
void |
setInitializeHidden(boolean value)
Gets or sets a value indicating to intialize all non-initialized values to hidden value.
|
void |
setInterpolateHidden(boolean value)
Gets or sets a value specifying to draw a connecting line over a missing data point.
|
void |
setPoints(int value)
Gets or sets a value indicating the number of series allocated for the chart.
|
void |
setSeries(int value)
Gets or sets a value indicating the number of series allocated for the chart.
|
void |
undoCompact()
If the data is compacted, this method uncompacts the data and shows all values.
|
public boolean isAggressiveAllocation()
chart1.getData().setAggressiveAllocation(true);
public void setAggressiveAllocation(boolean value)
chart1.getData().setAggressiveAllocation(true);
value
- public boolean isCompacted()
boolean isCompacted; isCompacted = chart1.getData().getCompacted();
public TimeSpan getCompactedByTimeSpan()
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
resetCompactedBy
public void setCompactedBy(TimeSpan value)
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
value
- resetCompactedBy
public DataUnit getCompactedBy()
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
resetCompactedBy
public void setCompactedBy(DataUnit value)
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
value
- resetCompactedBy
public double getCompactedByDouble()
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
resetCompactedBy
public void setCompactedBy(double value)
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
value
- resetCompactedBy
public java.util.Date getCompactedByDateTime()
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
resetCompactedBy
public void setCompactedBy(java.util.Date value)
Gets or sets a value indicating the interval of units to compress data.
This method is used to configure the units for compression in the X Axis. If the XAxis has been passed DateTime XValues and has been formated for Date, the units represented by the setCompactedBy
method would be Days. For example a value of 30 would be interperted into 1 Month. If you do not have configured XValues in the chart, then the unit base is 1 (categorical axis).
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The undoCompact
method is used to decompress compacted data and show all values.
The setData
method is used to access the DataValues object for a chart.
To configure the number of units to Compact a chart to 30:
chart1.getData().setCompactedBy(5);
value
- resetCompactedBy
public boolean isInitializeHidden()
Gets or sets a value indicating to intialize all non-initialized values to hidden value.
chart1.setGallery(Gallery.LINES);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
chart1.getData().setInitializeHidden(false);
java.util.Random rand;
rand = new java.util.Random();
chart1.getData().set(0, 3, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getData().set(0, 5, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getAxisY().setMax(10);
chart1.getAxisY().setMin(-10);
chart1.setGallery(Gallery.LINES);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
chart1.getData().setInitializeHidden(true);
java.util.Random rand;
rand = new java.util.Random();
chart1.getData().set(0, 3, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getData().set(0, 5, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getAxisY().setMax(10);
chart1.getAxisY().setMin(-10);
public void setInitializeHidden(boolean value)
Gets or sets a value indicating to intialize all non-initialized values to hidden value.
chart1.setGallery(Gallery.LINES);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
chart1.getData().setInitializeHidden(false);
java.util.Random rand;
rand = new java.util.Random();
chart1.getData().set(0, 3, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getData().set(0, 5, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getAxisY().setMax(10);
chart1.getAxisY().setMin(-10);
chart1.setGallery(Gallery.LINES);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
chart1.getData().setInitializeHidden(true);
java.util.Random rand;
rand = new java.util.Random();
chart1.getData().set(0, 3, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getData().set(0, 5, ((DataUnit)(10.0 * (rand.nextDouble()))));
chart1.getAxisY().setMax(10);
chart1.getAxisY().setMin(-10);
value
- public boolean isInterpolateHidden()
chart1.getData().setInterpolateHidden(true);
public void setInterpolateHidden(boolean value)
chart1.getData().setInterpolateHidden(true);
value
- public TimeSpan getTimeSpan(int series, int point)
series
- point
- public void set(int series, int point, TimeSpan value)
series
- point
- value
- public DataUnit get(int series, int point)
series
- point
- public void set(int series, int point, DataUnit value)
series
- point
- value
- public double getDouble(int series, int point)
series
- point
- public void set(int series, int point, double value)
series
- point
- value
- public java.util.Date getDateTime(int series, int point)
series
- point
- public void set(int series, int point, java.util.Date value)
series
- point
- value
- public java.util.List<java.lang.String> getLabels()
Provides access to label collection of the main x-axis.
int i; i = 0; for(; (i < (chart1.getData().getPoints())); ++(i)) { chart1.getData().getLabels().set((short)i, "Label" + SfxNET.System.Int32.Set_System_Int32(i)); }
public int getPoints()
Gets or sets a value indicating the number of series allocated for the chart.
The Points and setSeries
methods are usually set a design-time using the method dialog box for the Chart object. The only time these methods should be included in code is when you wish to read the number of series or points in a chart.
This methody is normally used to get the number of data points per series available in the chart for administration purposes. For example, if you want to change the values of each data point in a series, you will need the number of available points per series to complete the For loop.
To set a chart with two series, and five points per series:
chart1.getData().setSeries(2);
chart1.getData().setPoints(5);
public void setPoints(int value)
Gets or sets a value indicating the number of series allocated for the chart.
The Points and setSeries
methods are usually set a design-time using the method dialog box for the Chart object. The only time these methods should be included in code is when you wish to read the number of series or points in a chart.
This methody is normally used to get the number of data points per series available in the chart for administration purposes. For example, if you want to change the values of each data point in a series, you will need the number of available points per series to complete the For loop.
To set a chart with two series, and five points per series:
chart1.getData().setSeries(2);
chart1.getData().setPoints(5);
value
- public int getSeries()
Gets or sets a value indicating the number of series allocated for the chart.
The setPoints
and setSeries
methods are usually set a design-time using the method dialog box for the Chart
object. The only time these methods should be included in code is when you wish to read the number of series or points in a chart.
This method is normally used to get the number of series available on the chart for administration purposes. For example, if you want to set a different color for each data series using the setColor
method, you will need the number of available data series to complete the For loop.
To set a chart with five series, and two points per series:
chart1.setGallery(Gallery.BAR);
chart1.getData().setSeries(5);
chart1.getData().setPoints(2);
public void setSeries(int value)
Gets or sets a value indicating the number of series allocated for the chart.
The setPoints
and setSeries
methods are usually set a design-time using the method dialog box for the Chart
object. The only time these methods should be included in code is when you wish to read the number of series or points in a chart.
This method is normally used to get the number of series available on the chart for administration purposes. For example, if you want to set a different color for each data series using the setColor
method, you will need the number of available data series to complete the For loop.
To set a chart with five series, and two points per series:
chart1.setGallery(Gallery.BAR);
chart1.getData().setSeries(5);
chart1.getData().setPoints(2);
value
- public IDataArray getX()
Allows you to set X-Values for specific point of XY plots.
chart1.getData().getX().set(0, 0, ((DataUnit)2.9)); chart1.getData().getY().set(0, 0, ((DataUnit)10.5));
public IDataArray getY()
Allows you to access the Y coordinates of the data points.
chart1.getData().getX().set(0, 0, ((DataUnit)1.2)); chart1.getData().getY().set(0, 0, ((DataUnit)5.3));
public IDataArray getYFrom()
Allows you to set the starting Y-value for a specific value on the chart.
chart1.setGallery(Gallery.GANTT); chart1.getData().getYFrom().set(0, 0, ((DataUnit)SfxNET.System.DateTime.getNow().AddHours(1.0).ToOADate())); chart1.getData().getY().set(0, 0, ((DataUnit)SfxNET.System.DateTime.getNow().AddHours(3.0).ToOADate()));
public void clear()
Clears all the data values in the chart.
After calling the method, the chart displays "No Data Available" message.
To clear passed values in a chart:
chart1.getData().clear();
public boolean commitChanges()
This method should not be required for normal chart generation, however it was found that it was useful in selected scenarios. This method instructs the chart to:
1) Compact data if Data Compaction features are used.
2) Equalizes Point and Series allocations.
3) Axis adjustments based on data.
These tasks will also be completed before the chart is rendered, however using this method developers may force this to occur on demand.
This method also returns a boolean value specifying if this has been completed.
To Commit data changes to the chart:
chart1.getData().CommitChanges();
public void compact(TimeSpan step)
Compacts the data in order to display more summarized information.
For example, there is a chart of 1 series and 10 points:
chart1.setGallery(Gallery.BAR); chart1.getLegendBox().setVisible(false); chart1.getData().setSeries(1); chart1.getData().setPoints(10); int i; i = 0; for(; (i < 10); (i)++) { chart1.getData().set(0, i, ((DataUnit)(1 + i))); }
After calling the compact
method with a step set to two (2), the result chart provides summarized data compacting every two bars into one and producing a new bar which is the minimum Y value of both bars:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMin());
chart1.getData().Compact(((DataUnit)2.0));
Similarly, this is the resulting chart when the step is set to five (5) and the CompactFormula is set to Max:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMax());
chart1.getData().Compact(((DataUnit)5.0));
The following is a sample code defining a custom handler to sum the values to be compacted.
Below is a chart using custom handler to sum the values to be compacted with a step set to 2:
undoCompact
method is used to decompress compacted data and show all values.setData
method is used to access the DataValues object for a chart.step
- public void compact(DataUnit step)
Compacts the data in order to display more summarized information.
For example, there is a chart of 1 series and 10 points:
chart1.setGallery(Gallery.BAR); chart1.getLegendBox().setVisible(false); chart1.getData().setSeries(1); chart1.getData().setPoints(10); int i; i = 0; for(; (i < 10); (i)++) { chart1.getData().set(0, i, ((DataUnit)(1 + i))); }
After calling the compact
method with a step set to two (2), the result chart provides summarized data compacting every two bars into one and producing a new bar which is the minimum Y value of both bars:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMin());
chart1.getData().Compact(((DataUnit)2.0));
Similarly, this is the resulting chart when the step is set to five (5) and the CompactFormula is set to Max:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMax());
chart1.getData().Compact(((DataUnit)5.0));
The following is a sample code defining a custom handler to sum the values to be compacted.
Below is a chart using custom handler to sum the values to be compacted with a step set to 2:
undoCompact
method is used to decompress compacted data and show all values.setData
method is used to access the DataValues object for a chart.step
- public void compact(double step)
Compacts the data in order to display more summarized information.
For example, there is a chart of 1 series and 10 points:
chart1.setGallery(Gallery.BAR); chart1.getLegendBox().setVisible(false); chart1.getData().setSeries(1); chart1.getData().setPoints(10); int i; i = 0; for(; (i < 10); (i)++) { chart1.getData().set(0, i, ((DataUnit)(1 + i))); }
After calling the compact
method with a step set to two (2), the result chart provides summarized data compacting every two bars into one and producing a new bar which is the minimum Y value of both bars:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMin());
chart1.getData().Compact(((DataUnit)2.0));
Similarly, this is the resulting chart when the step is set to five (5) and the CompactFormula is set to Max:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMax());
chart1.getData().Compact(((DataUnit)5.0));
The following is a sample code defining a custom handler to sum the values to be compacted.
Below is a chart using custom handler to sum the values to be compacted with a step set to 2:
undoCompact
method is used to decompress compacted data and show all values.setData
method is used to access the DataValues object for a chart.step
- public void compact(java.util.Date step)
Compacts the data in order to display more summarized information.
For example, there is a chart of 1 series and 10 points:
chart1.setGallery(Gallery.BAR); chart1.getLegendBox().setVisible(false); chart1.getData().setSeries(1); chart1.getData().setPoints(10); int i; i = 0; for(; (i < 10); (i)++) { chart1.getData().set(0, i, ((DataUnit)(1 + i))); }
After calling the compact
method with a step set to two (2), the result chart provides summarized data compacting every two bars into one and producing a new bar which is the minimum Y value of both bars:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMin());
chart1.getData().Compact(((DataUnit)2.0));
Similarly, this is the resulting chart when the step is set to five (5) and the CompactFormula is set to Max:
chart1.setGallery(Gallery.BAR);
chart1.getLegendBox().setVisible(false);
chart1.getData().setSeries(1);
chart1.getData().setPoints(10);
int i;
i = 0;
for(; (i < 10); (i)++)
{
chart1.getData().set(0, i, ((DataUnit)(1 + i)));
}
chart1.getData().getY().setCompactFormula(CompactFormulas.getMax());
chart1.getData().Compact(((DataUnit)5.0));
The following is a sample code defining a custom handler to sum the values to be compacted.
Below is a chart using custom handler to sum the values to be compacted with a step set to 2:
undoCompact
method is used to decompress compacted data and show all values.setData
method is used to access the DataValues object for a chart.step
- public void recalculateScale()
The recalculateScale
of the Chart
Please keep in mind that this method reads the entire data array, so abusing this method could affect the performance of your application, as Chart FX will read the entire data array every time this method is called.
This method should be invoked to force Chart FX to calculate the setMin
, setMax
, setMinorStepDateTime
, and setStep
for the Axis
.
This method will not affect the setStep
and setMinorStepDateTime
methods if they have been previously set. To make sure that they respond to this method, set the setStep
and setMinorStepDateTime
methods to zero (0).
A typical case of when to use this method is when you disable the isAutoScale
method to calculate the setMin
and setMax
methods and you set new data to the chart that causes the scale values to be recalculated to show the appropriate data.
When using a isStacked
style chart, recalculating the scale will sometimes make the chart more readable.
To recalculate scale values for all numerical axes:
chart1.getData().recalculateScale();
public void removeSeries(int seriesIndex)
When a Series is removed from the collection using this method, all the indexes will be recalculated and the methods will remain associated with the old index. So if you assign methods to Series index 2, and then remove that series, Series index 3 (if it exists) will assume all the methods of old Series index 2 (including the index number).
To remove the Series index 2 from collection.
chart1.getData().RemoveSeries(2);
seriesIndex
- Index of Series to be removed.public void resetCompactedBy()
setCompactedBy
public void resetFlags()
public void undoCompact()
If the data is compacted, this method uncompacts the data and shows all values.
The data compression features provide developers with a mechanism to display data in different intervals, summarizing historical data. The compact
method is used to complete the compacting process.
The isCompacted
returns a value indicating whether or not the data is compacted.
The setData
method is used to access the DataValues object for a chart.
To decompress a chart with Compacted data:
chart1.getData().UndoCompact();
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.