public class ConditionalAttributes extends PointAttributes
The members of the ConditionalAttributes class allow developers to control when special attributes should be applied to the chart and what chart elements will be taken into consideration when they are applied.
Once the object has been configured with the desired attributes, the object may be assigned to a chart's point, based on the configured conditions. The value of each point in the chart is evaluated based on the conditions of each ConditionalAttributes item. Points that meet the conditions of a particular conditional attribute item will retain the settings of that item. For more information regarding the configuration of the conditions, please see the Condition
class.
chart1.getData().setSeries(1);
chart1.getData().setPoints(20);
chart1.setGallery(Gallery.SCATTER);
chart1.getSeries().get(0).setMarkerShape(MarkerShape.RECT);
chart1.getSeries().get(0).setText("Normal");
chart1.getLegendBox().setDock(DockArea.BOTTOM);
chart1.getLegendBox().setFont(new java.awt.Font("Arial",java.awt.Font.PLAIN, 7));
RangeCondition range1;
range1 = new RangeCondition();
range1.setTo(20);
range1.setToOpen(true);
ConditionalAttributes condition1;
condition1 = new ConditionalAttributes();
condition1.setCondition(range1);
condition1.setColor(new java.awt.Color(128,128,128,255));
condition1.setMarkerSize((short)5);
condition1.setMarkerShape(MarkerShape.CIRCLE);
condition1.setText("Underqualified");
chart1.getConditionalAttributes().add((condition1));
RangeCondition range2;
range2 = new RangeCondition();
range2.setFrom(80);
ConditionalAttributes condition2;
condition2 = new ConditionalAttributes();
condition2.setColor(new java.awt.Color(255,0,0,255));
condition2.setMarkerSize((short)5);
condition2.setMarkerShape(MarkerShape.TRIANGLE);
condition2.setCondition(range2);
condition2.setText("Overqualified");
chart1.getConditionalAttributes().add((condition2));
Constructor and Description |
---|
ConditionalAttributes()
Constructs a newly allocated ConditionalAttributes object
|
ConditionalAttributes(double from,
double to,
java.awt.Color color)
Constructs a newly allocated ConditionalAttributes object
|
Modifier and Type | Method and Description |
---|---|
Condition |
getCondition()
Returns a Condition object for the specified ConditionalAttributes object.
|
RangeCondition |
getRangeCondition()
Description goes here
|
int |
getSeriesToAffect()
Gets or sets a value indicating which series index the ConditionalAttribute will be applied to.
|
void |
resetSeries()
Set the property Series to its default value.
|
void |
setCondition(Condition value)
Returns a Condition object for the specified ConditionalAttributes object.
|
void |
setSeriesToAffect(int value)
Gets or sets a value indicating which series index the ConditionalAttribute will be applied to.
|
getAlternateColor, getBarShape, getBorder, getColor, getEffects, getFillMode, getLine, getLink, getMarkerShape, getMarkerShapeCharacter, getMarkerSize, getMarkerStyle, getMarkerTemplate, getMarkerWidth, getPattern, getPicture, getPointLabels, getSeparateSlice, getTag, getText, getVolume, setAlternateColor, setBarShape, setColor, setFillMode, setMarkerShape, setMarkerShapeCharacter, setMarkerSize, setMarkerStyle, setMarkerTemplate, setMarkerWidth, setPattern, setPicture, setSeparateSlice, setTag, setText, setVolume
public ConditionalAttributes()
public ConditionalAttributes(double from, double to, java.awt.Color color)
from
- to
- color
- public Condition getCondition()
Returns a Condition object for the specified ConditionalAttributes object.
You may use this object to manipulate the conditions in which the ConditionalAttribute applies.
To configure a ConditionalAttributes object:
chart1.getConditionalAttributes().get(0).getCondition().setActive(true);
public void setCondition(Condition value)
Returns a Condition object for the specified ConditionalAttributes object.
You may use this object to manipulate the conditions in which the ConditionalAttribute applies.
To configure a ConditionalAttributes object:
chart1.getConditionalAttributes().get(0).getCondition().setActive(true);
value
- public RangeCondition getRangeCondition()
public int getSeriesToAffect()
Gets or sets a value indicating which series index the ConditionalAttribute will be applied to.
By default, ConditionalAttributes are applied to all series in the chart. To reset a ConditionalAttribute to be applied to all series, set the setSeriesToAffect
method to -1.
The setCondition
method is used to obtain the Condition
object for a selected ConditionalAttribute. Using this object you may configure the conditions for the ConditionalAttributes object.
To instruct Chart FX to apply the selected ConditionalAttribute to the 2nd series only:
chart1.getConditionalAttributes().get(1).setSeries(1);
public void setSeriesToAffect(int value)
Gets or sets a value indicating which series index the ConditionalAttribute will be applied to.
By default, ConditionalAttributes are applied to all series in the chart. To reset a ConditionalAttribute to be applied to all series, set the setSeriesToAffect
method to -1.
The setCondition
method is used to obtain the Condition
object for a selected ConditionalAttribute. Using this object you may configure the conditions for the ConditionalAttributes object.
To instruct Chart FX to apply the selected ConditionalAttribute to the 2nd series only:
chart1.getConditionalAttributes().get(1).setSeries(1);
value
- public void resetSeries()
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.