public class PointLabelOrganizer
extends java.lang.Object
Provides access to the PointLabelOrganizer object.
The PointLabelOrganizer object supports members to enable developers with built-in features to try and display point labels in the most visual appealing manner. By default, point labels are painted in the same order in which the series/points they are associated. This can cause overlapping and unreadable point labels.
The PointLabelOrganizer class supports members not only to bring all labels to the front to avoid this issue, but also internal algorithms used to reposition and even hide offending point labels. Additionally, members have been implemented to allow the developer control over acceptable point label collisions, time limits used for organizing and even caching features.
| Constructor and Description |
|---|
PointLabelOrganizer()
Constructs a newly allocated PointLabelOrganizer object
|
| Modifier and Type | Method and Description |
|---|---|
double |
getMaximumCollisions()
Gets or sets a acceptable percentage rate of collisions (clipped or overlapping labels).
|
int |
getMaximumTime()
Gets or sets a value specifying the maximum time limit used to arrange point labels.
|
boolean |
isAutoArrange()
Gets or sets a value specifying to use internal alogrithms to arrange point labels.
|
boolean |
isCache()
Gets or sets a value specifying to save PointLabels in memory.
|
boolean |
isEnabled()
Gets or sets a value specifying if the PointLabelOrganizer feature is enabled.
|
void |
resetAutoArrange()
Set the property AutoArrange to its default value.
|
void |
resetCache()
Set the property Cache to its default value.
|
void |
resetEnabled()
Set the property Enabled to its default value.
|
void |
resetMaximumCollisions()
Set the property MaximumCollisions to its default value.
|
void |
resetMaximumTime()
Set the property MaximumTime to its default value.
|
void |
setAutoArrange(boolean value)
Gets or sets a value specifying to use internal alogrithms to arrange point labels.
|
void |
setCache(boolean value)
Gets or sets a value specifying to save PointLabels in memory.
|
void |
setEnabled(boolean value)
Gets or sets a value specifying if the PointLabelOrganizer feature is enabled.
|
void |
setMaximumCollisions(double value)
Gets or sets a acceptable percentage rate of collisions (clipped or overlapping labels).
|
void |
setMaximumTime(int value)
Gets or sets a value specifying the maximum time limit used to arrange point labels.
|
public PointLabelOrganizer()
public boolean isAutoArrange()
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setAutoArrange(true);
resetAutoArrangepublic void setAutoArrange(boolean value)
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setAutoArrange(true);
value - resetAutoArrangepublic boolean isCache()
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setCache(true);
resetCachepublic void setCache(boolean value)
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setCache(true);
value - resetCachepublic boolean isEnabled()
Gets or sets a value specifying if the PointLabelOrganizer feature is enabled.
The setPointLabelOrganizer method (GlobalAttributes) is used to access the PointLabelOrganizer object of a chart.
The isEnabled method is a boolean used to enable the PointLabelOrganizer feature. When enabled, all point labels are brought to the front of the chart (painted last). If this method is disabled, PointLabels will be painted at the same time as each corresponding point marker. This can cause point labels of initial series to be overwritten and clipped by markers and labels of following series.
The isAutoArrange method may be used to instruct Chart FX to use internal alogrithms to calculate the best locations for PointLabels and even hide some labels if they become intrusive to the chart's display.
The isCache method may be used to instruct the chart that point labels will be saved in memory rather than refreshed each time the chart is redrawn. Setting this method to true increases memory usage but makes charts more efficient.
The setMaximumCollisions method is used to specify a percentage of collisions (clipped or overlapping labels) acceptable by the developer. Once the internal alogrithm has reached this benchmark, violating point labels are hidden and the chart is displayed.
The setMaximumTime method is used to configure the maximum amount of time to be used for PointLabel organization features. This time is measured in milliseconds.
To enable the PointLabelOrganizer:
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true);
resetEnabledpublic void setEnabled(boolean value)
Gets or sets a value specifying if the PointLabelOrganizer feature is enabled.
The setPointLabelOrganizer method (GlobalAttributes) is used to access the PointLabelOrganizer object of a chart.
The isEnabled method is a boolean used to enable the PointLabelOrganizer feature. When enabled, all point labels are brought to the front of the chart (painted last). If this method is disabled, PointLabels will be painted at the same time as each corresponding point marker. This can cause point labels of initial series to be overwritten and clipped by markers and labels of following series.
The isAutoArrange method may be used to instruct Chart FX to use internal alogrithms to calculate the best locations for PointLabels and even hide some labels if they become intrusive to the chart's display.
The isCache method may be used to instruct the chart that point labels will be saved in memory rather than refreshed each time the chart is redrawn. Setting this method to true increases memory usage but makes charts more efficient.
The setMaximumCollisions method is used to specify a percentage of collisions (clipped or overlapping labels) acceptable by the developer. Once the internal alogrithm has reached this benchmark, violating point labels are hidden and the chart is displayed.
The setMaximumTime method is used to configure the maximum amount of time to be used for PointLabel organization features. This time is measured in milliseconds.
To enable the PointLabelOrganizer:
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true);
value - resetEnabledpublic double getMaximumCollisions()
Gets or sets a acceptable percentage rate of collisions (clipped or overlapping labels).
The isAutoArrange method may be used to instruct Chart FX to use internal alogrithms to calculate the best locations for PointLabels and even hide some labels if they become intrusive to the chart's display. In order for the MaximumCollisions and MaximumTime methods to be realized, AutoArrange must be set to true.
The setMaximumCollisions method is used to specify a percentage of collisions (clipped or overlapping labels) acceptable by the developer. Once the internal alogrithm has reached this benchmark, violating point labels are hidden and the chart is displayed.
The setMaximumTime method is used to configure the maximum amount of time to be used for PointLabel organization features. This time is measured in milliseconds.
The setPointLabelOrganizer method (GlobalAttributes) is used to access the PointLabelOrganizer object of a chart.
The isEnabled method is a boolean used to enable the PointLabelOrganizer feature. When enabled, all point labels are brought to the front of the chart (painted last). If this method is disabled, PointLabels will be painted at the same time as each corresponding point marker. This can cause point labels of initial series to be overwritten and clipped by markers and labels of following series.
The isCache method may be used to instruct the chart that point labels will be saved in memory rather than refreshed each time the chart is redrawn. Setting this method to true increases memory usage but makes charts more efficient.
To set the MaximumCollisions to 50%:
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setAutoArrange(true); pntLblOrganizer.setMaximumCollisions(50); pntLblOrganizer.setMaximumTime(1000);
resetMaximumCollisionspublic void setMaximumCollisions(double value)
Gets or sets a acceptable percentage rate of collisions (clipped or overlapping labels).
The isAutoArrange method may be used to instruct Chart FX to use internal alogrithms to calculate the best locations for PointLabels and even hide some labels if they become intrusive to the chart's display. In order for the MaximumCollisions and MaximumTime methods to be realized, AutoArrange must be set to true.
The setMaximumCollisions method is used to specify a percentage of collisions (clipped or overlapping labels) acceptable by the developer. Once the internal alogrithm has reached this benchmark, violating point labels are hidden and the chart is displayed.
The setMaximumTime method is used to configure the maximum amount of time to be used for PointLabel organization features. This time is measured in milliseconds.
The setPointLabelOrganizer method (GlobalAttributes) is used to access the PointLabelOrganizer object of a chart.
The isEnabled method is a boolean used to enable the PointLabelOrganizer feature. When enabled, all point labels are brought to the front of the chart (painted last). If this method is disabled, PointLabels will be painted at the same time as each corresponding point marker. This can cause point labels of initial series to be overwritten and clipped by markers and labels of following series.
The isCache method may be used to instruct the chart that point labels will be saved in memory rather than refreshed each time the chart is redrawn. Setting this method to true increases memory usage but makes charts more efficient.
To set the MaximumCollisions to 50%:
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setAutoArrange(true); pntLblOrganizer.setMaximumCollisions(50); pntLblOrganizer.setMaximumTime(1000);
value - resetMaximumCollisionspublic int getMaximumTime()
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setAutoArrange(true); pntLblOrganizer.setMaximumCollisions(50); pntLblOrganizer.setMaximumTime(3000);
resetMaximumTimepublic void setMaximumTime(int value)
PointLabelOrganizer pntLblOrganizer; pntLblOrganizer = chart1.getAllSeries().getPointLabelOrganizer(); pntLblOrganizer.setEnabled(true); pntLblOrganizer.setAutoArrange(true); pntLblOrganizer.setMaximumCollisions(50); pntLblOrganizer.setMaximumTime(3000);
value - resetMaximumTimepublic void resetAutoArrange()
isAutoArrangepublic void resetCache()
isCachepublic void resetEnabled()
isEnabledpublic void resetMaximumCollisions()
setMaximumCollisionspublic void resetMaximumTime()
setMaximumTime2014 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.