|
Chart FX for Java 6.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSoftwareFX.ChartFX.SeriesAttributes
Provides access to the SeriesAttributes object.
The chart series are represented by groups of data points. For example if you want to plot yearly sales for two different products. Product A and Product B are called the series of the chart. For example, if you create a bar chart, two groups of bars will appear, a group of bars will represent each product and each bar will represent actual sales for a particular month, as depicted in the following figure:
The series object allows you to set everything related to the series of the chart, including data, legends and visual attributes like colors, chart types and border styles among others.
What's important about the series object is that you can use properties available in this object to set specific settings to individual series in the chart without affecting the other ones. For example, if you want to create a combination (multitype) chart, where Product A is plotted as line with data labels and Product B is displayed as bars with no borders, you can access each series properties using the series object and obtain the following chart:
Constructor Summary | |
SeriesAttributes()
|
|
SeriesAttributes(Chart chart,
int index)
|
Method Summary | |
void |
drawMarker(java.awt.Graphics2D g,
java.awt.Point pt,
int item,
int radius,
boolean drawLine)
Used to draw a marker on a selected device context. |
void |
DrawMarker(java.awt.Graphics2D g,
java.awt.Point pt,
int item,
int radius,
boolean drawLine)
Deprecated. You should use drawMarker instead. |
java.awt.Color |
getAlternateColor()
Allows you to set the alternate color for a selected item when using gradient scheme. |
java.awt.Color |
getBorderColor()
Allows you to set a border color for a selected item in the chart. |
int |
getBorderEffect()
Specifies the valid border effects for a selected item. |
java.awt.Color |
getColor()
Sets a color for the selected series. |
short |
getCylSides()
Sets the 3D shape of the selected item. |
int |
getGallery()
Sets the chart type for a particular series. |
java.lang.String |
getLegend()
Allows you to set a legend (categorical Axis labels) for the selected series. |
int |
getLineEndCap()
Sets an ending marker shape for lines in the borders of 3D charts. |
int |
getLineStartCap()
Sets an starting marker shape for lines in the borders of 3D charts. |
int |
getLineStyle()
Used to set a line style to the selected item. |
short |
getLineWidth()
Used to set the line weight or thickness for the selected item. |
Link |
getLink()
Gets the Link object for a selected PointAttributes item. |
int |
getMarkerShape()
Used to specify the point type used to paint markers for the selected item. |
short |
getMarkerSize()
Controls the size of the markers for the selected item. |
short |
getMarkerStep()
Controls how frequently point markers are shown in the selected series. |
int |
getPattern()
Allows you to set a pattern for the selected item. |
java.awt.Image |
getPicture()
Allows you to set a picture to the selected item. |
int |
getPointLabelAlign()
Allows you to align point labels using the marker as a reference for the selected item. |
short |
getPointLabelAngle()
Allows you to display the point label at the specified angle for the selected item. |
java.awt.Color |
getPointLabelColor()
Allows you to change the color of point labels for the selected item. |
java.awt.Font |
getPointLabelFont()
Allows you to change the text font attributes for the point labels of the selected item. |
int |
getScheme()
Allows you to change the color scheme for a selected item. |
short |
getSeparateSlice()
Allows you to separate a slice of a Pie or Doughnut chart for a selected item. |
int |
getSmoothFlags()
Sets the rendering quality for the selected series and text related to this series. |
java.lang.Object |
getTag()
Assign a string to any item for retrieval later. |
int |
getTypeMask()
Allows you to set additional attributes to the selected item. |
java.lang.String |
getURL()
Deprecated. You should use SeriesAttributes.getLink().getUrl instead. |
short |
getVolume()
Allows you to specify a volume for a data point markers in supported galleries. |
int |
getYAxis()
Allows you to move (or assign) the selected data series to a different numerical axis. |
boolean |
isBorder()
Allows you to show or hide marker borders for a selected item. |
boolean |
isInternalBorder()
Gets or sets a value indicating whether a chart will have an internal border. |
boolean |
isPointLabels()
Allows you to display the value via point label for a selected item. |
boolean |
isStacked()
Allows you to stack the selected series with the previous series to achieve multi-stacked charts. |
boolean |
isVisible()
Shows or hides the selected series. |
void |
setAlternateColor(java.awt.Color value)
Allows you to set the alternate color for a selected item when using gradient scheme. |
void |
setBorder(boolean value)
Allows you to show or hide marker borders for a selected item. |
void |
setBorderColor(java.awt.Color value)
Allows you to set a border color for a selected item in the chart. |
void |
setBorderEffect(int value)
Specifies the valid border effects for a selected item. |
void |
setColor(java.awt.Color value)
Sets a color for the selected series. |
void |
setCylSides(short value)
Sets the 3D shape of the selected item. |
void |
setGallery(int value)
Sets the chart type for a particular series. |
void |
setInternalBorder(boolean value)
Gets or sets a value indicating whether a chart will have an internal border. |
void |
setLegend(java.lang.String value)
Allows you to set a legend (categorical Axis labels) for the selected series. |
void |
setLineEndCap(int value)
Sets an ending marker shape for lines in the borders of 3D charts. |
void |
setLineStartCap(int value)
Sets an starting marker shape for lines in the borders of 3D charts. |
void |
setLineStyle(int value)
Used to set a line style to the selected item. |
void |
setLineWidth(short value)
Used to set the line weight or thickness for the selected item. |
void |
setMarkerShape(int value)
Used to specify the point type used to paint markers for the selected item. |
void |
setMarkerSize(short value)
Controls the size of the markers for the selected item. |
void |
setMarkerStep(short value)
Controls how frequently point markers are shown in the selected series. |
void |
setPattern(int value)
Allows you to set a pattern for the selected item. |
void |
setPicture(java.awt.Image value)
Allows you to set a picture to the selected item. |
void |
setPointLabelAlign(int value)
Allows you to align point labels using the marker as a reference for the selected item. |
void |
setPointLabelAngle(short value)
Allows you to display the point label at the specified angle for the selected item. |
void |
setPointLabelColor(java.awt.Color value)
Allows you to change the color of point labels for the selected item. |
void |
setPointLabelFont(java.awt.Font value)
Allows you to change the text font attributes for the point labels of the selected item. |
void |
setPointLabels(boolean value)
Allows you to display the value via point label for a selected item. |
void |
setScheme(int value)
Allows you to change the color scheme for a selected item. |
void |
setSeparateSlice(short value)
Allows you to separate a slice of a Pie or Doughnut chart for a selected item. |
void |
setSmoothFlags(int value)
Sets the rendering quality for the selected series and text related to this series. |
void |
setStacked(boolean value)
Allows you to stack the selected series with the previous series to achieve multi-stacked charts. |
void |
setTag(java.lang.Object value)
Assign a string to any item for retrieval later. |
void |
setTypeMask(int value)
Allows you to set additional attributes to the selected item. |
void |
setURL(java.lang.String value)
Deprecated. You should use SeriesAttributes.getLink().setUrl instead. |
void |
setVisible(boolean value)
Shows or hides the selected series. |
void |
setVolume(short value)
Allows you to specify a volume for a data point markers in supported galleries. |
void |
setYAxis(int value)
Allows you to move (or assign) the selected data series to a different numerical axis. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SeriesAttributes()
public SeriesAttributes(Chart chart, int index)
Method Detail |
public void drawMarker(java.awt.Graphics2D g, java.awt.Point pt, int item, int radius, boolean drawLine)
Used to draw a marker on a selected device context.
This method allows you to draw a markers to a selected device context without ever assigning the values to a chart.
g
- A Graphics object is associated with a specific device context.pt
- A Point object with the desired X and Y coordinates where the marker will be drawn.item
- Index of the marker item you wish to draw. (If a specific point index has been assigned special attributes you want to use, i.e. MarkerShape) Set to -1 to use default series assignments.radius
- Controls the size of the markershape.drawLine
- Specifies if the markers will have a line on either side of the marker. (Simulate markers in a line chart)DefaultBorder.draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color)
,
ImageBorder.draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color)
,
GradientBackground.draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color)
,
DefaultBorder
,
ImageBorder
,
GradientBackground
public void DrawMarker(java.awt.Graphics2D g, java.awt.Point pt, int item, int radius, boolean drawLine)
drawMarker
instead.
public java.awt.Color getAlternateColor()
Allows you to set the alternate color for a selected item when using gradient scheme.
This property is used in conjunction with PointAttributes.setScheme(int)
property. You need to set the scheme to gradient in order to use AlternateColor property.
chart1.setScheme(Scheme.GRADIENT);
To create a gradient for an item, you first need to set an initial color using the setColor(java.awt.Color)
property. Then you can assign a AlternateColor to complete the gradient assignment.
For more information regarding the Color type, please refer to the Java API Documentation.
setColor(java.awt.Color)
,
PointAttributes.setScheme(int)
,
SeriesAttributes
public java.awt.Color getBorderColor()
Allows you to set a border color for a selected item in the chart.
In order to see the color set using this property, you must make sure the PointAttributes.setBorderEffect(int)
is set to BorderEffect.None and make sure the border for the selected item is visible (default setting) by using the PointAttributes.setBorder(boolean)
property.
This property applies to the selected item in the chart. If you want to apply it for all items in a chart, please refer to the Chart's Chart.setBorderColor(java.awt.Color)
property.
To set the Border Effect, Line Style and Line Width, please refer to the PointAttributes.setBorderEffect(int)
, PointAttributes.setLineStyle(int)
and PointAttributes.setLineWidth(short)
properties respectively.
For more information regarding the Color type, please refer to the Java API Documentation.
PointAttributes.setBorder(boolean)
,
PointAttributes.setBorderEffect(int)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setLineWidth(short)
,
SeriesAttributes
public int getBorderEffect()
Specifies the valid border effects for a selected item.
BorderEffect :
Specify different border effects that may be applied to a object.Value | Description |
NONE | No border effect is applied. The border effect must be None for the BorderColor property to take effect. |
RAISED | The border has raised inner and outer edges. |
LIGHT | Apply light color to the border using the series/points color. |
DARK | Apply dark color to the border using the series/points color. |
OPPOSITE | Chooses between dark and light border depending on the object color. If the color is dark Chart FX will choose a light border color. If the color is light Chart FX will choose a dark border color. |
SHADOW | The border will have shadow. |
When setting this property, make sure the border for the selected item is visible by using the PointAttributes.setBorder(boolean)
property.
The BorderEffect property must be set to BorderEffect.None for the PointAttributes.setBorderColor(java.awt.Color)
property to have any effect on the selected item border.
To set the Border Color, Line Style and Line Width, please refer to the PointAttributes.setBorderColor(java.awt.Color)
,PointAttributes.setLineStyle(int)
and PointAttributes.setLineWidth(short)
properties respectively.
PointAttributes.setBorder(boolean)
,
PointAttributes.setBorderColor(java.awt.Color)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setLineWidth(short)
,
Chart
,
SeriesAttributes
public java.awt.Color getColor()
Sets a color for the selected series.
If no colors are specified, The default color is automatically selected by Chart FX when you create the chart, and chosen according to the current palette and its position in the series array.
The color property is used to set a specific color to the selected series. You can control colors of other chart elements using the PointAttributes.setBorderColor(java.awt.Color)
, Chart.setBackColor(java.awt.Color)
and Chart.setInsideColor(java.awt.Color)
properties.
For more information regarding the Color type, please refer to the Java API Documentation.
Chart.setBackColor(java.awt.Color)
,
PointAttributes.setBorderColor(java.awt.Color)
,
Chart.setInsideColor(java.awt.Color)
,
Chart
,
PointAttributes
public short getCylSides()
Sets the 3D shape of the selected item.
You can create different cylindrical and conical shapes.
This property can only be applied to BAR, CUBES or GANTT charts. When specifying a large number of sides in the base (i.e. -32 or 32) it may be a good idea to get rid off the border (Border Property), this will create a seamless color effect on the marker.
With this property you will set individual items to different conical or cylindrical shapes. For example, using this property you can combine Cylinders with Cones. If you want to apply the setting to the entire chart (all data series),you can use the general Chart.setCylSides(short)
property.
Setting this property to a positive number [1,32] will create a cylindrical shape.
Setting this property to a negative number [-32,-1] will create a conical shape. For example if you want to convert bars into pyramids (base 3) you can set the value of this property to -3.
Making the Chart a 3D chart using the Chart.setChart3D(boolean)
property is not required, however the 3D markers are in better context.
Chart.setGallery(int)
,
PointAttributes.setBorder(boolean)
,
Chart.setChart3D(boolean)
,
Chart
,
SeriesAttributes
public int getGallery()
Sets the chart type for a particular series. All chart types are available in both 2D and 3D modes.
Gallery :
Defines the chart type.Value | Description |
LINES | Line Chart. |
BAR | Bar Chart. |
CURVE | Spline Curve chart. |
SCATTER | Scatter or XY Plot. |
PIE | Pie Chart. |
AREA | Area Chart. |
PARETO | Pareto Chart. |
STEP | Step Lines Chart |
HI_LOW_CLOSE | Hi-Low-Close Chart. |
SURFACE | Surface Plot. |
RADAR | Radar Chart. |
CUBE | Cubes Chart. |
DOUGHNUT | Doughnut Chart. |
PYRAMID | Pyramid Chart. |
BUBBLE | Bubble Chart. |
OPEN_HI_LOW_CLOSE | Open-Hi-Lo-Close Chart. |
CANDLESTICK | CandleStick Chart. |
CONTOUR | Contour Chart. |
CURVE_AREA | Curve Area Chart. |
GANTT | Horizontal Bar Chart. |
Applying this property to a specific series will create a MultiType chart, where different Chart Types can be combined in the same chart. For example, if you initially created a bar chart with 3 series, you can convert the first series to a line chart as follows:
chart1.getSeries(0).setGallery(Gallery.LINES);
You must be careful of the chart types you select to combine as not all of them will produce desirable results. For example, combining a chart that does not have numerical axis (e.g. Pie Chart) with a chart that has a numerical axis (e.g. Line Chart) will produce a chart that can't be read by the end user.
A rule of thumb is that you can combine axis charts with similar types and non-axis charts with similar types, as follows:
Axis Charts:
Lines, Bar, Curve, Scatter, Area, Step, HiLowClose, Cube, Bubble, CandleStick, CurveArea, OpenHiLowClose, Pareto.
Non-axis charts:
Pie, Radar, DoughNut, Pyramid
Note: Gantt, Surface and Contour can't be combined with other chart types
Another important issue to keep in mind when creating MultiType charts is the number of series each chart type requires to properly plot the data. For example, an Open-Hi-Lo-Close chart requires 4 consecutive series to properly plot the data, so if you want to combine this chart type with a line chart, the series containing the data for the line chart must be either the first or the last series in the data set.
Chart.setGallery(int)
,
Chart
public java.lang.String getLegend()
Allows you to set a legend (categorical Axis labels) for the selected series.
Once you have set the series legend in the chart, you can treat the legend window as an additional tool with different properties that can be accessed using the Chart.getSerLegBoxObj()
property.
Use the Chart.setSerLegBox(boolean)
property to make the series legend box visible.
You can also use the Chart.getSerLeg(int)
property to define names for your series.
Chart.getSerLeg(int)
,
Chart.setSerLegBox(boolean)
,
Chart.getSerLegBoxObj()
,
LegendBox
,
Chart
public int getLineEndCap()
Sets an ending marker shape for lines in the borders of 3D charts.
LineCap :
Specifies the available cap styles with which a line can end.Value | Description |
ANCHOR_MASK | Specifies a mask used to check whether a line cap is an anchor cap. |
ARROW_ANCHOR | Specifies an arrow-shaped anchor cap. |
CUSTOM | Specifies a custom line cap. |
DIAMOND_ANCHOR | Specifies a diamond anchor cap. |
FLAT | Specifies a flat line cap. |
NO_ANCHOR | Specifies no anchor. |
ROUND | Specifies a round line cap. |
ROUND_ANCHOR | Specifies a round anchor cap. |
SQUARE | Specifies a square line cap. |
SQUARE_ANCHOR | Specifies a square anchor line cap. |
TRIANGLE | Specifies a triangular line cap. |
Adjusting the line width using the PointAttributes.setLineWidth(short)
property makes the border of the point or series markers set with this property more and less noticeable.
Set the chart to 3D mode using the Chart.setChart3D(boolean)
property to see the shape created using the PointAttributes.setLineStartCap(int)
and LineEndCap properties.
The PointAttributes.setLineStyle(int)
property allows you to apply an addition style to the selected items.
For more information regarding the Drawing type, please refer to the Java API Documentation.
PointAttributes.setLineStartCap(int)
,
Chart.setChart3D(boolean)
,
PointAttributes.setLineWidth(short)
,
PointAttributes.setLineStyle(int)
,
Chart
public int getLineStartCap()
Sets an starting marker shape for lines in the borders of 3D charts.
LineCap :
Specifies the available cap styles with which a line can end.Value | Description |
ANCHOR_MASK | Specifies a mask used to check whether a line cap is an anchor cap. |
ARROW_ANCHOR | Specifies an arrow-shaped anchor cap. |
CUSTOM | Specifies a custom line cap. |
DIAMOND_ANCHOR | Specifies a diamond anchor cap. |
FLAT | Specifies a flat line cap. |
NO_ANCHOR | Specifies no anchor. |
ROUND | Specifies a round line cap. |
ROUND_ANCHOR | Specifies a round anchor cap. |
SQUARE | Specifies a square line cap. |
SQUARE_ANCHOR | Specifies a square anchor line cap. |
TRIANGLE | Specifies a triangular line cap. |
Adjusting the line width using the PointAttributes.setLineWidth(short)
property makes the border of the point or series markers set with this property more and less noticeable.
Set the chart to 3D mode using the Chart.setChart3D(boolean)
property to see the shape created using the LineStartCap and PointAttributes.setLineEndCap(int)
properties.
The PointAttributes.setLineStyle(int)
property allows you to apply an addition style to the selected items.
For more information regarding the Drawing type, please refer to the Java API Documentation.
PointAttributes.setLineEndCap(int)
,
Chart.setChart3D(boolean)
,
PointAttributes.setLineWidth(short)
,
PointAttributes.setLineStyle(int)
,
Chart
public int getLineStyle()
Used to set a line style to the selected item.
DashStyle :
Specifies the style with which dashed lines are drawn.Value | Description |
CUSTOM | Specifies a user-defined custom dash style. |
DASH | Specifies a line consisting of dashes. |
DASH_DOT | Specifies a line consisting of a repeating pattern of dash-dot. |
DASH_DOT_DOT | Specifies a line consisting of a repeating pattern of dash-dot-dot. |
DOT | Specifies a line consisting of dots. |
SOLID | Specifies a solid line. |
If you're displaying a 2D Line chart, this property will set the 2D line style. For other charts, this property controls the style of the border surrounding the marker.
If you're using this property for a different chart type (other than a 2D Line chart) you can set the Border Color and Width, with the PointAttributes.setBorderColor(java.awt.Color)
and PointAttributes.setLineWidth(short)
properties respectively. However, you must make sure the Border is visible by setting the Border property to True.
For more information regarding the Drawing type, please refer to the Java API Documentation.
PointAttributes.setBorder(boolean)
,
PointAttributes.setLineWidth(short)
,
PointAttributes.setBorderColor(java.awt.Color)
,
SeriesAttributes
public short getLineWidth()
Used to set the line weight or thickness for the selected item.
If you're displaying a 2D Line chart, this property will set the line thickness. For other charts, this property controls the thickness of the border surrounding the marker.
If you're using this property for a different chart type (other than a 2D Line chart) you can set the Border Color and Style, with the PointAttributes.setBorderColor(java.awt.Color)
and PointAttributes.setLineStyle(int)
properties respectively. However, you must make sure the Border is visible by setting the Border property to True.
PointAttributes.setBorder(boolean)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setBorderColor(java.awt.Color)
,
SeriesAttributes
public Link getLink()
Gets the Link object for a selected PointAttributes item.
Developers may obtain the Link object for a PointAttributes item using this property. Using the supported Link class members, developers may configure a Link.setUrl(java.lang.String)
and Link.setTarget(java.lang.String)
for the object.
Link.setUrl(java.lang.String)
,
Link.setTarget(java.lang.String)
,
Link
public int getMarkerShape()
Used to specify the point type used to paint markers for the selected item.
MarkerShape :
Defines different shapes used to paint point markers in the chart. Value | Description |
NONE | Do not display point markers. |
RECT | Displays a rectangle. |
CIRCLE | Displays a circle. |
TRIANGLE | Displays a triangle. |
DIAMOND | Displays a diamond. |
MARBLE | Displays a 3D marble. |
HORZ_LINE | Displays a horizontal line. |
VERT_LINE | Displays a vertical line. |
CROSS | Displays a cross. |
INVERTED_TRIANGLE | Displays a rotated triangle. |
X | Displays an X. |
MANY | Selects a combination of the above. |
PICTURE | Displays a configured picture. |
Point markers will not be shown in 3D line charts.
This property applies only to: LINES, CURVE, SCATTER, PARETO, STEP and RADAR charts.
You can control the size of the points with the PointAttributes.setMarkerSize(short)
property, or how frequently do they appear on the selected series by using the Chart.setMarkerStep(short)
property.
You can set custom images as chart markers by setting this property to the 'Picture' enumeration and setting an image using the PointAttributes.setPicture(java.awt.Image)
property.
PointAttributes.setMarkerSize(short)
,
Chart.setMarkerStep(short)
,
Chart.setPointFont(java.awt.Font)
,
Chart.setGallery(int)
,
Chart
,
SeriesAttributes
public short getMarkerSize()
Controls the size of the markers for the selected item.
This property sets the radius of the marker in physical units (pixels). You must make sure the PointAttributes.setMarkerShape(int)
Property is set to a valid point type (other than None), before setting this property.
Point markers will not be shown in 3D line charts.
You can control the shape (or type) of the points with the PointAttributes.setMarkerShape(int)
property, or how frequently do they appear on the selected series by using the setMarkerStep(short)
property.
PointAttributes.setMarkerShape(int)
,
setMarkerStep(short)
,
Chart.setMarkerStep(short)
,
Chart
,
SeriesAttributes
public short getMarkerStep()
Controls how frequently point markers are shown in the selected series.
This property is very useful when the chart contains a large number of points and the point markers disturb the chart's readability. For example, if you are showing 100 points in a line chart, the physical separation (pixels) of them is very small and probably the point markers will make the chart unreadable to the end user. In this case, you can set this property to force Chart FX to show point markers every 20 points.
Point markers will not be shown in 3D line charts.
You must make sure the PointAttributes.setMarkerShape(int)
Property is set to a valid point type (other than None), before setting this property.
You can control the shape and Size of the point markers with the PointAttributes.setMarkerShape(int)
property and PointAttributes.setMarkerSize(short)
properties, respectively.
You can extend the point types available by setting this property to an integer representing the negative ASCII code from any font. By default, Chart FX uses the WingDings font table to handle additional point types. For changing the default font, use the Chart.setPointFont(java.awt.Font)
property.
PointAttributes.setMarkerSize(short)
,
PointAttributes.setMarkerShape(int)
,
Chart.setPointFont(java.awt.Font)
,
Chart
public int getPattern()
Allows you to set a pattern for the selected item.
HatchStyle :
Specifies the different hatch patterns available.Value | Description |
BACKWARD_DIAGONAL | A pattern of lines on a diagonal from upper right to lower left. |
CROSS | Specifies horizontal and vertical lines that cross. |
DARK_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, are spaced 50 percent closer together than, and are twice the width of ForwardDiagonal. This hatch pattern is not antialiased. |
DARK_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal and are twice the width of HatchStyleHorizontal. |
DARK_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, are spaced 50 percent closer together than BackwardDiagonal, and are twice its width, but the lines are not antialiased. |
DARK_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical and are twice its width. |
DASHED_DOWNWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the right from top points to bottom points. |
DASHED_HORIZONTAL | Specifies dashed horizontal lines. |
DASHED_UPWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the left from top points to bottom points. |
DASHED_VERTICAL | Specifies dashed vertical lines. |
DIAGONAL_BRICK | Specifies a hatch that has the appearance of layered bricks that slant to the left from top points to bottom points. |
DIAGONAL_CROSS | Specifies forward diagonal and backward diagonal lines that cross. The lines are antialiased. |
DIVOT | Specifies a hatch that has the appearance of divots. |
DOTTED_DIAMOND | Specifies forward diagonal and backward diagonal lines, each of which is composed of dots, that cross. |
DOTTED_GRID | Specifies horizontal and vertical lines, each of which is composed of dots, that cross. |
FORWARD_DIAGONAL | A pattern of lines on a diagonal from upper left to lower right. |
HORIZONTAL | A pattern of horizontal lines. |
HORIZONTAL_BRICK | Specifies a hatch that has the appearance of horizontally layered bricks. |
LARGE_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard with squares that are twice the size of SmallCheckerBoard. |
LARGE_CONFETTI | Specifies a hatch that has the appearance of confetti, and is composed of larger pieces than SmallConfetti. |
LARGE_GRID | Specifies the hatch style Cross. |
LIGHT_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points and are spaced 50 percent closer together than DownwardDiagonal, but they are not antialiased. |
LIGHT_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal. |
LIGHT_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points and are spaced 50 percent closer together than BackwardDiagonal, but they are not antialiased. |
LIGHT_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical. |
MAX | Specifies hatch style SolidDiamond. |
MIN | Specifies hatch style Horizonal. |
NARROW_HORIZONTAL | Specifies horizontal lines that are spaced 75 percent closer together than hatch style Horizontal (or 25 percent closer together than LightHorizontal). |
NARROW_VERTICAL | Specifies vertical lines that are spaced 75 percent closer together than hatch style Vertical (or 25 percent closer together than LightVertical). |
OUTLINED_DIAMOND | Specifies forward diagonal and backward diagonal lines that cross but are not antialiased. |
PERCENT_05 | Specifies a 5-percent hatch. The ratio of foreground color to background color is 5:100. |
PERCENT_10 | Specifies a 10-percent hatch. The ratio of foreground color to background color is 10:100. |
PERCENT_20 | Specifies a 20-percent hatch. The ratio of foreground color to background color is 20:100. |
PERCENT_25 | Specifies a 25-percent hatch. The ratio of foreground color to background color is 25:100. |
PERCENT_30 | Specifies a 30-percent hatch. The ratio of foreground color to background color is 30:100. |
PERCENT_40 | Specifies a 40-percent hatch. The ratio of foreground color to background color is 40:100. |
PERCENT_50 | Specifies a 50-percent hatch. The ratio of foreground color to background color is 50:100. |
PERCENT_60 | Specifies a 60-percent hatch. The ratio of foreground color to background color is 60:100. |
PERCENT_70 | Specifies a 70-percent hatch. The ratio of foreground color to background color is 70:100. |
PERCENT_75 | Specifies a 75-percent hatch. The ratio of foreground color to background color is 75:100. |
PERCENT_80 | Specifies a 80-percent hatch. The ratio of foreground color to background color is 80:100. |
PERCENT_90 | Specifies a 90-percent hatch. The ratio of foreground color to background color is 90:100. |
PLAID | Specifies a hatch that has the appearance of a plaid material. |
SHINGLE | Specifies a hatch that has the appearance of diagonally-layered shingles that slant to the right from top points to bottom points. |
SMALL_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard. |
SMALL_CONFETTI | Specifies a hatch that has the appearance of confetti. |
SMALL_GRID | Specifies horizontal and vertical lines that cross and are spaced 50 percent closer together than hatch style Cross. |
SOLID_DIAMOND | Specifies a hatch that has the appearance of a checkerboard placed diagonally. |
SPHERE | Specifies a hatch that has the appearance of spheres laid adjacent to one another. |
TRELLIS | Specifies a hatch that has the appearance of a trellis. |
VERTICAL | A pattern of vertical lines. |
WAVE | Specifies horizontal lines that are composed of tildes. |
WEAVE | Specifies a hatch that has the appearance of a woven material. |
WIDE_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, have the same spacing as hatch style ForwardDiagonal, and are triple its width, but are not antialiased. |
WIDE_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, have the same spacing as hatch style BackwardDiagonal, and are triple its width, but are not antialiased. |
ZIG_ZAG | Specifies horizontal lines that are composed of zigzags. |
To use this property, you must make sure the chart scheme (PointAttributes.setScheme(int)
property) is set to either B&W or colored patterns.
If the chart's scheme is set to colored patterns you can set both the background and foreground color of the pattern with the setColor(java.awt.Color)
and PointAttributes.setAlternateColor(java.awt.Color)
properties, respectively.
PointAttributes.setScheme(int)
,
setColor(java.awt.Color)
,
PointAttributes.setAlternateColor(java.awt.Color)
,
SeriesAttributes
,
Chart
public java.awt.Image getPicture()
Allows you to set a picture to the selected item.
The Picture property may be used in two different ways depending on the chart's gallery and scheme:
1. If the chart gallery is one that uses point markers, meaning you can set the shape of the marker using the MarkerShape property, then the configured image will be used as a point marker as long as the PointAttributes.setMarkerShape(int)
for that point is set to MarkerShape.Picture.
2. If the chart gallery is one that uses bars, area markers or pie slices (Bar, Area or Pie type charts), the image will be tiled in the selected series or point. However, in order for the tiled effect to be applied you must set the PointAttributes.setScheme(int)
to Scheme.Pattern.
The Legends and DataEditor will also show the picture but with an appropriated size. Notice that if you do not set the PointAttributes.setScheme(int)
to Scheme.Pattern, the configured picture will only be used with charts that have point markers.
When this property is set to a 3D chart, the sides of the markers (3D perspective) are painted with the configured series color.
For more information regarding the Image type, please refer to the Java API Documentation.
setGallery(int)
,
SeriesAttributes
public int getPointLabelAlign()
Allows you to align point labels using the marker as a reference for the selected item.
LabelAlign :
Define the ways of aligning point labels using the marker as a reference. Value | Description |
LEFT | The label will be left aligned to the marker. |
CENTER | The label will be centered with the marker. |
RIGHT | The label will be right aligned to the marker. |
TOP | The label will be on the top edge of the marker. |
VCENTER | The label will be vertically centered. |
BOTTOM | The label will be on the bottom edge of the marker. |
The right way of setting this property is to chose a horizontal and vertical alignment styles and combined them using the Or (bitwise) operator, as follows:
chart1.getPoint(0, 0).setPointLabelAlign(LabelAlign.LEFT | LabelAlign.TOP);
To use this property, you must make sure the point labels are visible (PointAttributes.setPointLabels(boolean)
property).
Although you can set a general alignment for labels showing data values, Chart FX may overwrite such setting to avoid an undesired display of the point label. For example, if you have negative values in the chart, Chart FX will overwrite the Centered-Bottom alignment to a Centered-Top alignment so the label will show properly for points having negative values.
You can also control the label angle with the PointAttributes.setPointLabelAngle(short)
property.
To set the font associated with the selected point label, please refer to the PointAttributes.setPointLabelFont(java.awt.Font)
property.
To set the font color associated with the point labels please refer to the PointAttributes.setPointLabelColor(java.awt.Color)
property.
PointAttributes.setPointLabelColor(java.awt.Color)
,
PointAttributes.setPointLabelFont(java.awt.Font)
,
PointAttributes.setPointLabels(boolean)
,
PointAttributes.setPointLabelAngle(short)
,
Chart
,
SeriesAttributes
public short getPointLabelAngle()
Allows you to display the point label at the specified angle for the selected item.
The PointAttributes.setPointLabels(boolean)
must be visible in order to view the label angle configured.
You can also control the text alignment with the PointAttributes.setPointLabelAlign(int)
property.
The font for a selected item may be customized using the PointAttributes.setPointLabelFont(java.awt.Font)
property.
Use a positive number to rotate the labels from lower left to upper right. Use negative degrees to rotate text from upper left to lower right. (Range [-90,90])
PointAttributes.setPointLabelFont(java.awt.Font)
,
PointAttributes.setPointLabelAlign(int)
,
PointAttributes.setPointLabels(boolean)
,
Chart
,
SeriesAttributes
public java.awt.Color getPointLabelColor()
Allows you to change the color of point labels for the selected item.
The Chart.setPointLabels(boolean)
property must first be set to True in order to view the color of the point label.
It is recommended to use light point label colors when the Chart.setInsideColor(java.awt.Color)
or a series of a Bar chart is a dark color (and, vice versa).
The Chart.setPointLabelColor(java.awt.Color)
property is a global property to change the color for all point labels.
You may modify the font of the selected item using the PointAttributes.setPointLabelFont(java.awt.Font)
property.
For more information regarding the Color type, please refer to the Java API Documentation.
Chart.setPointLabels(boolean)
,
Chart.setInsideColor(java.awt.Color)
,
Chart.setPointLabelColor(java.awt.Color)
,
PointAttributes.setPointLabelFont(java.awt.Font)
,
Chart
public java.awt.Font getPointLabelFont()
Allows you to change the text font attributes for the point labels of the selected item.
When setting a font in Chart FX, you must create a new font object with the desired attributes and assign that object to the desired chart element every time you want to change the font.
You can set the color for a selected point label using the PointAttributes.setPointLabelColor(java.awt.Color)
property.
The Chart.setPointLabels(boolean)
property must first be set to True in order to view the font of the point label.
For more information regarding the Font type, please refer to the Java API Documentation.
Chart.setPointLabels(boolean)
,
PointAttributes.setPointLabelColor(java.awt.Color)
,
Chart.setFont(java.awt.Font)
,
Chart
public int getScheme()
Allows you to change the color scheme for a selected item.
Scheme :
Define color scheme in the chart. Value | Description |
SOLID | Use solid colors. |
BW_PATTERN | Use Black & White patterns. |
PATTERN | Use colored patterns. |
GRADIENT | Use Gradient when painting the chart series |
The difference between patterns and hatched patterns is that hatched patterns are defined by windows and they can be resized when printing the charts. However, there are limited hatched patterns available.
The Chart FX patternbar uses patterns (not hatched) that are suitable for the screen but when they are printed, they are defined as 8x8 pixels and therefore they will not be visible when printing with high resolution printer (i.e. 600 dpi). The Printer.setForceColors(boolean)
property in the printer object uses hatched patterns to print the charts.
A general rule of thumb is to use patterns for the screen and hatched patterns when printing the chart.
When creating gradients on point markers, the Scheme must be set to Gradient. The setColor(java.awt.Color)
and PointAttributes.setAlternateColor(java.awt.Color)
properties can be set to create the desired gradient colors.
PointAttributes.setAlternateColor(java.awt.Color)
,
PointAttributes.setPattern(int)
,
setColor(java.awt.Color)
,
Chart.setScheme(int)
,
Chart
,
SeriesAttributes
public short getSeparateSlice()
Allows you to separate a slice of a Pie or Doughnut chart for a selected item.
Setting this property to 100 will make the vertex of the slice to be on the edge of the pie.
Chart FX does not provide administrative properties, such as the biggest slice in a PIE chart, so if you want to separate a particular slice based on a certain condition, you must first determine the slice to be separated based on the data contained in the chart.
Chart.setGallery(int)
,
setGallery(int)
,
Chart
public int getSmoothFlags()
Sets the rendering quality for the selected series and text related to this series.
SmoothFlags :
Sets the rendering qualityValue | Description |
FILL | Specifies antialiased rendering inside of the chart. |
BORDER | Specifies antialiased rendering on chart borders. |
TEXT | Specifies that each character is antialiased rendering. |
NONE | Specifies no antialiasing. |
TEXT_SYSTEM | Specifies to use the system settings. |
To change the chart rendering quality use directly the chart Chart.setSmoothFlags(int)
property.
Chart.setSmoothFlags(int)
,
Chart
public java.lang.Object getTag()
Assign a string to any item for retrieval later.
This string can be viewed when the mouse is placed over a point in a series using the Chart.setShowTips(boolean)
property.
The Chart.setPointLabelMask(java.lang.String)
and Chart.setTipMask(java.lang.String)
properties have a format called %L to display the Tag if exists.
Chart.setShowTips(boolean)
,
Chart.setPointLabelMask(java.lang.String)
,
Chart.setTipMask(java.lang.String)
,
Chart
public int getTypeMask()
Allows you to set additional attributes to the selected item.
ChartType :
Define additional visual attributes in the chart and allows to turn on/off them. Value | Description |
PAINT_MARKER | This constant will turn on message event for customize chart drawing process. |
COLOR_LINE | This constant specifies that the lines of a 2D Line Chart must be drawn using colors. |
SHOW_3D | See Chart3D. |
HORZ | See Gallery. |
TOOL | See Toolbar. |
PALETTE | See PaletteBar. |
LEGEND | See LegendBox. |
HIDE_SERIES | This constant will hide all chart series. |
EACH_BAR | See MultipleColors. |
CLUSTER | See Cluster. |
SHOW_DATA | See DataEditor. |
EDITOR | This constant will show the Data Editor. See DataEditor. |
DLG_GRAY | This constant will cause the dialogs to be shown with a gray background, to provide support for applications that also use gray backgrounds. This keeps the graphics library consistent with the rest of the client application. |
PATTERN | See PatternBar. |
SHOW_VALUES | See PointLabels. |
POINT_LABELS | This constant will show the point markers on a Line or Spline Chart. |
MENU | See MenuBar. |
DEFAULT | See property default. |
INTERNAL_BORDER | This constant will show an internal border for supported Chart FX tools in the chart area. |
NO_BORDERS | See Border. |
PIE_VALUES | This constant specifies that the values must be painted in the pie chart (instead of painting the percentages). |
TRACK_MOUSE | This constant has to be included for those charts you want to capture mouse tracking. |
EVEN_SPACING | This constant specifies points in the x axis will be even spaced, which means that points will be equally distanced in the x axis. When apply, this can cause a behavior in which you will see a blank gap at the right side of the chart, since the points can not be equally distance. Useful with real-time charts. (Default = Off) |
SER_LEGEND | See SerLegBox. |
GLOBAL | Internal use. Refers all enumerations that effect the chart globally, not by point or series. |
USER_LEGEND | Shows or Hides the user legend box in the chart. See UserLegendBox. |
Some of the available flags in this property are supported by individual properties of the object which will apply changes to the selected item. If you want to apply some flags to the entire chart, please refer to the chart's Chart.setTypeEx(int)
Property.
This property is a mask property. this means all settings represent a bit in the word that you need to turn on or off according to what you want. For this purpose you will use the bitwise operators (And, Or, Not, Xor) provided by your development tool. Because it is a mask property, you must make sure you use these operators to turn on/off bits and avoid losing previous settings to the property.For example if you want to include the NoBorders setting, the right way of setting this property is:
chart1.getPoint(0,0).setTypeMask(chart1.getPoint(0,0).getTypeMask() | TypeMask.NO_BORDERS);
(RIGHT!)
If you type the following code:
chart1.getPoint(0,0).setTypeMask(TypeMask.NO_BORDERS);
(WRONG!)
You'll erase all other settings in the property causing an erratic behavior of the library and an incorrect setting of the individual properties which also control these flags.
Chart.setTypeEx(int)
,
Chart.setChartStyle(int)
,
PointAttributes.setPointLabels(boolean)
,
PointAttributes.setBorder(boolean)
,
setVisible(boolean)
,
Chart
,
SeriesAttributes
public java.lang.String getURL()
SeriesAttributes.getLink().getUrl
instead.
getLink()
public short getVolume()
Allows you to specify a volume for a data point markers in supported galleries. By adjusting the volume, you can modify the amount of space you want between the items.
The larger the value, the lesser the distance between the selected point and its neighbors.
This property has a dual functionality depending on the clustered status of the chart, as follows:
If the chart is clustered, this property is used to specify the amount of space between the selected point and its neighbors in the z-axis (a.k.a. Gap Depth). When used in this context, this property is used for any chart type that supports clustered options (Including Multi-Type charts)
When the chart is not clustered, this property controls the amount of space between the selected point and its neighbors in the x-axis (a.k.a. Gap Width). When used in this context, this property applies to any chart type that allows side to side positioning of the series (BAR, BUBBLE, CANDLESTICK, HI-LO-CLOSE, OPEN-HI-LOW-CLOSE and CUBES).
If you want to control the Volume property for all the series in the chart (i.e. apply the same volume setting to all of them) you can use the chart class Chart.setVolume(short)
property.
Chart.setGallery(int)
,
Chart.setVolume(short)
,
setGallery(int)
,
Chart
,
SeriesAttributes
public int getYAxis()
Allows you to move (or assign) the selected data series to a different numerical axis.
YAxis :
Defines the main or secondary Y Axis when assigning series to a selected Y axis.Value | Description |
MAIN | Main Y axis. |
SECONDARY | Secondary Y axis. |
Chart FX supports two Y axes with different and independent scales, you can use this property to associate data series with any of these axis. A typical example of a double Y axis chart is a financial (volume) chart, where the price of the stock ranges from 70-90 and the volume traded ranges from 500.000 to 2.000.000. Obviously, when you attempt to plot both series in the same chart, the scale needed in one axis to plot both series will not produce desirable results. In this case, you'll use this property to associate the stock price data series with the primary Y axis (ranging from 70-90) and the volume traded series with a secondary Y axis (ranging from 0 to 2.000.000).
When assigning a series to a Secondary Y axis you should make sure that you make the axis assignment before passing data. By doing this, Chart FX will calculate the Axis.setMax(double)
, Axis.setMin(double)
and Axis.setStep(double)
for the secondary Y axis automatically. If the axis assignment is done after the data has been passed, you can set the Max, Min and Step manually or call the Chart.recalcScale()
method. Please keep in mind that calling the RecalcScale method is a less efficient way to create the chart.
Once you have set a specific data series to a chart, you can customize the axis settings using any of the properties supported by the Axis
Object.
Chart.getAxis(int)
,
Chart.getAxisX()
,
Chart.getAxisY()
,
Axis.setMax(double)
,
Axis.setMin(double)
,
Axis.setStep(double)
,
Chart.recalcScale()
,
Axis
,
Chart
public boolean isBorder()
Allows you to show or hide marker borders for a selected item.
The effect of this property on 2D line charts is slightly different, as follows:
When set to False, the 2D line color will be equal to the item color assigned with the setColor(java.awt.Color)
property. When set to True and the BorderEffect is set to BorderEffect.None, the 2D line color will be equal to the color set with the PointAttributes.setBorderColor(java.awt.Color)
property.
To set the Border Style and Width for the Point, please refer to the PointAttributes.setLineStyle(int)
and PointAttributes.setLineWidth(short)
properties respectively.
PointAttributes.setBorderColor(java.awt.Color)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setLineWidth(short)
,
SeriesAttributes
public boolean isInternalBorder()
Gets or sets a value indicating whether a chart will have an internal border.
This property only affects selected chart gallery types. For example, Pie, Area and Doughnut galleries will have an internal border painted between slices/sections when this property is set to true.
Chart.setGallery(int)
,
Chart.getPoint(int, int)
,
Chart.getSeries(int)
,
Chart
public boolean isPointLabels()
Allows you to display the value via point label for a selected item.
You can also control the text alignment and text display angle with the PointAttributes.setPointLabelAlign(int)
and PointAttributes.setPointLabelAngle(short)
properties, respectively.
You can modify the font of the selected point label using the PointAttributes.setPointLabelFont(java.awt.Font)
property.
PointAttributes.setPointLabelAlign(int)
,
PointAttributes.setPointLabelAngle(short)
,
PointAttributes.setPointLabelFont(java.awt.Font)
,
SeriesAttributes
public boolean isStacked()
Allows you to stack the selected series with the previous series to achieve multi-stacked charts.
Stacked options apply only to Bar and Area charts. So before applying this property, you must make sure the previous series and the selected series are of the same type (Bar or Area).
You can also use the Chart.setStacked(int)
property of the Chart
object to assign the attribute to all series.
Chart.setStacked(int)
,
Chart
public boolean isVisible()
Shows or hides the selected series.
Hiding an Series will:
- not recalculate any of the scale values for the axis.
- not remove the data associated with it.
- hide the legend associated with it from the Series Legend.
- hide all the data points in the Data Editor.
If you hide a Series and want Chart FX to recalculate the axis scale values, you must invoke the Chart.recalcScale()
method when you show and/or hide the selected Series.
Chart.recalcScale()
,
PointAttributes
public void setAlternateColor(java.awt.Color value)
Allows you to set the alternate color for a selected item when using gradient scheme.
This property is used in conjunction with PointAttributes.setScheme(int)
property. You need to set the scheme to gradient in order to use AlternateColor property.
chart1.setScheme(Scheme.GRADIENT);
To create a gradient for an item, you first need to set an initial color using the setColor(java.awt.Color)
property. Then you can assign a AlternateColor to complete the gradient assignment.
For more information regarding the Color type, please refer to the Java API Documentation.
setColor(java.awt.Color)
,
PointAttributes.setScheme(int)
,
SeriesAttributes
public void setBorder(boolean value)
Allows you to show or hide marker borders for a selected item.
The effect of this property on 2D line charts is slightly different, as follows:
When set to False, the 2D line color will be equal to the item color assigned with the setColor(java.awt.Color)
property. When set to True and the BorderEffect is set to BorderEffect.None, the 2D line color will be equal to the color set with the PointAttributes.setBorderColor(java.awt.Color)
property.
To set the Border Style and Width for the Point, please refer to the PointAttributes.setLineStyle(int)
and PointAttributes.setLineWidth(short)
properties respectively.
PointAttributes.setBorderColor(java.awt.Color)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setLineWidth(short)
,
SeriesAttributes
public void setBorderColor(java.awt.Color value)
Allows you to set a border color for a selected item in the chart.
In order to see the color set using this property, you must make sure the PointAttributes.setBorderEffect(int)
is set to BorderEffect.None and make sure the border for the selected item is visible (default setting) by using the PointAttributes.setBorder(boolean)
property.
This property applies to the selected item in the chart. If you want to apply it for all items in a chart, please refer to the Chart's Chart.setBorderColor(java.awt.Color)
property.
To set the Border Effect, Line Style and Line Width, please refer to the PointAttributes.setBorderEffect(int)
, PointAttributes.setLineStyle(int)
and PointAttributes.setLineWidth(short)
properties respectively.
For more information regarding the Color type, please refer to the Java API Documentation.
PointAttributes.setBorder(boolean)
,
PointAttributes.setBorderEffect(int)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setLineWidth(short)
,
SeriesAttributes
public void setBorderEffect(int value)
Specifies the valid border effects for a selected item.
BorderEffect :
Specify different border effects that may be applied to a object.Value | Description |
NONE | No border effect is applied. The border effect must be None for the BorderColor property to take effect. |
RAISED | The border has raised inner and outer edges. |
LIGHT | Apply light color to the border using the series/points color. |
DARK | Apply dark color to the border using the series/points color. |
OPPOSITE | Chooses between dark and light border depending on the object color. If the color is dark Chart FX will choose a light border color. If the color is light Chart FX will choose a dark border color. |
SHADOW | The border will have shadow. |
When setting this property, make sure the border for the selected item is visible by using the PointAttributes.setBorder(boolean)
property.
The BorderEffect property must be set to BorderEffect.None for the PointAttributes.setBorderColor(java.awt.Color)
property to have any effect on the selected item border.
To set the Border Color, Line Style and Line Width, please refer to the PointAttributes.setBorderColor(java.awt.Color)
,PointAttributes.setLineStyle(int)
and PointAttributes.setLineWidth(short)
properties respectively.
PointAttributes.setBorder(boolean)
,
PointAttributes.setBorderColor(java.awt.Color)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setLineWidth(short)
,
Chart
,
SeriesAttributes
public void setColor(java.awt.Color value)
Sets a color for the selected series.
If no colors are specified, The default color is automatically selected by Chart FX when you create the chart, and chosen according to the current palette and its position in the series array.
The color property is used to set a specific color to the selected series. You can control colors of other chart elements using the PointAttributes.setBorderColor(java.awt.Color)
, Chart.setBackColor(java.awt.Color)
and Chart.setInsideColor(java.awt.Color)
properties.
For more information regarding the Color type, please refer to the Java API Documentation.
Chart.setBackColor(java.awt.Color)
,
PointAttributes.setBorderColor(java.awt.Color)
,
Chart.setInsideColor(java.awt.Color)
,
Chart
,
PointAttributes
public void setCylSides(short value)
Sets the 3D shape of the selected item.
You can create different cylindrical and conical shapes.
This property can only be applied to BAR, CUBES or GANTT charts. When specifying a large number of sides in the base (i.e. -32 or 32) it may be a good idea to get rid off the border (Border Property), this will create a seamless color effect on the marker.
With this property you will set individual items to different conical or cylindrical shapes. For example, using this property you can combine Cylinders with Cones. If you want to apply the setting to the entire chart (all data series),you can use the general Chart.setCylSides(short)
property.
Setting this property to a positive number [1,32] will create a cylindrical shape.
Setting this property to a negative number [-32,-1] will create a conical shape. For example if you want to convert bars into pyramids (base 3) you can set the value of this property to -3.
Making the Chart a 3D chart using the Chart.setChart3D(boolean)
property is not required, however the 3D markers are in better context.
Chart.setGallery(int)
,
PointAttributes.setBorder(boolean)
,
Chart.setChart3D(boolean)
,
Chart
,
SeriesAttributes
public void setGallery(int value)
Sets the chart type for a particular series. All chart types are available in both 2D and 3D modes.
Gallery :
Defines the chart type.Value | Description |
LINES | Line Chart. |
BAR | Bar Chart. |
CURVE | Spline Curve chart. |
SCATTER | Scatter or XY Plot. |
PIE | Pie Chart. |
AREA | Area Chart. |
PARETO | Pareto Chart. |
STEP | Step Lines Chart |
HI_LOW_CLOSE | Hi-Low-Close Chart. |
SURFACE | Surface Plot. |
RADAR | Radar Chart. |
CUBE | Cubes Chart. |
DOUGHNUT | Doughnut Chart. |
PYRAMID | Pyramid Chart. |
BUBBLE | Bubble Chart. |
OPEN_HI_LOW_CLOSE | Open-Hi-Lo-Close Chart. |
CANDLESTICK | CandleStick Chart. |
CONTOUR | Contour Chart. |
CURVE_AREA | Curve Area Chart. |
GANTT | Horizontal Bar Chart. |
Applying this property to a specific series will create a MultiType chart, where different Chart Types can be combined in the same chart. For example, if you initially created a bar chart with 3 series, you can convert the first series to a line chart as follows:
chart1.getSeries(0).setGallery(Gallery.LINES);
You must be careful of the chart types you select to combine as not all of them will produce desirable results. For example, combining a chart that does not have numerical axis (e.g. Pie Chart) with a chart that has a numerical axis (e.g. Line Chart) will produce a chart that can't be read by the end user.
A rule of thumb is that you can combine axis charts with similar types and non-axis charts with similar types, as follows:
Axis Charts:
Lines, Bar, Curve, Scatter, Area, Step, HiLowClose, Cube, Bubble, CandleStick, CurveArea, OpenHiLowClose, Pareto.
Non-axis charts:
Pie, Radar, DoughNut, Pyramid
Note: Gantt, Surface and Contour can't be combined with other chart types
Another important issue to keep in mind when creating MultiType charts is the number of series each chart type requires to properly plot the data. For example, an Open-Hi-Lo-Close chart requires 4 consecutive series to properly plot the data, so if you want to combine this chart type with a line chart, the series containing the data for the line chart must be either the first or the last series in the data set.
Chart.setGallery(int)
,
Chart
public void setInternalBorder(boolean value)
Gets or sets a value indicating whether a chart will have an internal border.
This property only affects selected chart gallery types. For example, Pie, Area and Doughnut galleries will have an internal border painted between slices/sections when this property is set to true.
Chart.setGallery(int)
,
Chart.getPoint(int, int)
,
Chart.getSeries(int)
,
Chart
public void setLegend(java.lang.String value)
Allows you to set a legend (categorical Axis labels) for the selected series.
Once you have set the series legend in the chart, you can treat the legend window as an additional tool with different properties that can be accessed using the Chart.getSerLegBoxObj()
property.
Use the Chart.setSerLegBox(boolean)
property to make the series legend box visible.
You can also use the Chart.getSerLeg(int)
property to define names for your series.
Chart.getSerLeg(int)
,
Chart.setSerLegBox(boolean)
,
Chart.getSerLegBoxObj()
,
LegendBox
,
Chart
public void setLineEndCap(int value)
Sets an ending marker shape for lines in the borders of 3D charts.
LineCap :
Specifies the available cap styles with which a line can end.Value | Description |
ANCHOR_MASK | Specifies a mask used to check whether a line cap is an anchor cap. |
ARROW_ANCHOR | Specifies an arrow-shaped anchor cap. |
CUSTOM | Specifies a custom line cap. |
DIAMOND_ANCHOR | Specifies a diamond anchor cap. |
FLAT | Specifies a flat line cap. |
NO_ANCHOR | Specifies no anchor. |
ROUND | Specifies a round line cap. |
ROUND_ANCHOR | Specifies a round anchor cap. |
SQUARE | Specifies a square line cap. |
SQUARE_ANCHOR | Specifies a square anchor line cap. |
TRIANGLE | Specifies a triangular line cap. |
Adjusting the line width using the PointAttributes.setLineWidth(short)
property makes the border of the point or series markers set with this property more and less noticeable.
Set the chart to 3D mode using the Chart.setChart3D(boolean)
property to see the shape created using the PointAttributes.setLineStartCap(int)
and LineEndCap properties.
The PointAttributes.setLineStyle(int)
property allows you to apply an addition style to the selected items.
For more information regarding the Drawing type, please refer to the Java API Documentation.
PointAttributes.setLineStartCap(int)
,
Chart.setChart3D(boolean)
,
PointAttributes.setLineWidth(short)
,
PointAttributes.setLineStyle(int)
,
Chart
public void setLineStartCap(int value)
Sets an starting marker shape for lines in the borders of 3D charts.
LineCap :
Specifies the available cap styles with which a line can end.Value | Description |
ANCHOR_MASK | Specifies a mask used to check whether a line cap is an anchor cap. |
ARROW_ANCHOR | Specifies an arrow-shaped anchor cap. |
CUSTOM | Specifies a custom line cap. |
DIAMOND_ANCHOR | Specifies a diamond anchor cap. |
FLAT | Specifies a flat line cap. |
NO_ANCHOR | Specifies no anchor. |
ROUND | Specifies a round line cap. |
ROUND_ANCHOR | Specifies a round anchor cap. |
SQUARE | Specifies a square line cap. |
SQUARE_ANCHOR | Specifies a square anchor line cap. |
TRIANGLE | Specifies a triangular line cap. |
Adjusting the line width using the PointAttributes.setLineWidth(short)
property makes the border of the point or series markers set with this property more and less noticeable.
Set the chart to 3D mode using the Chart.setChart3D(boolean)
property to see the shape created using the LineStartCap and PointAttributes.setLineEndCap(int)
properties.
The PointAttributes.setLineStyle(int)
property allows you to apply an addition style to the selected items.
For more information regarding the Drawing type, please refer to the Java API Documentation.
PointAttributes.setLineEndCap(int)
,
Chart.setChart3D(boolean)
,
PointAttributes.setLineWidth(short)
,
PointAttributes.setLineStyle(int)
,
Chart
public void setLineStyle(int value)
Used to set a line style to the selected item.
DashStyle :
Specifies the style with which dashed lines are drawn.Value | Description |
CUSTOM | Specifies a user-defined custom dash style. |
DASH | Specifies a line consisting of dashes. |
DASH_DOT | Specifies a line consisting of a repeating pattern of dash-dot. |
DASH_DOT_DOT | Specifies a line consisting of a repeating pattern of dash-dot-dot. |
DOT | Specifies a line consisting of dots. |
SOLID | Specifies a solid line. |
If you're displaying a 2D Line chart, this property will set the 2D line style. For other charts, this property controls the style of the border surrounding the marker.
If you're using this property for a different chart type (other than a 2D Line chart) you can set the Border Color and Width, with the PointAttributes.setBorderColor(java.awt.Color)
and PointAttributes.setLineWidth(short)
properties respectively. However, you must make sure the Border is visible by setting the Border property to True.
For more information regarding the Drawing type, please refer to the Java API Documentation.
PointAttributes.setBorder(boolean)
,
PointAttributes.setLineWidth(short)
,
PointAttributes.setBorderColor(java.awt.Color)
,
SeriesAttributes
public void setLineWidth(short value)
Used to set the line weight or thickness for the selected item.
If you're displaying a 2D Line chart, this property will set the line thickness. For other charts, this property controls the thickness of the border surrounding the marker.
If you're using this property for a different chart type (other than a 2D Line chart) you can set the Border Color and Style, with the PointAttributes.setBorderColor(java.awt.Color)
and PointAttributes.setLineStyle(int)
properties respectively. However, you must make sure the Border is visible by setting the Border property to True.
PointAttributes.setBorder(boolean)
,
PointAttributes.setLineStyle(int)
,
PointAttributes.setBorderColor(java.awt.Color)
,
SeriesAttributes
public void setMarkerShape(int value)
Used to specify the point type used to paint markers for the selected item.
MarkerShape :
Defines different shapes used to paint point markers in the chart. Value | Description |
NONE | Do not display point markers. |
RECT | Displays a rectangle. |
CIRCLE | Displays a circle. |
TRIANGLE | Displays a triangle. |
DIAMOND | Displays a diamond. |
MARBLE | Displays a 3D marble. |
HORZ_LINE | Displays a horizontal line. |
VERT_LINE | Displays a vertical line. |
CROSS | Displays a cross. |
INVERTED_TRIANGLE | Displays a rotated triangle. |
X | Displays an X. |
MANY | Selects a combination of the above. |
PICTURE | Displays a configured picture. |
Point markers will not be shown in 3D line charts.
This property applies only to: LINES, CURVE, SCATTER, PARETO, STEP and RADAR charts.
You can control the size of the points with the PointAttributes.setMarkerSize(short)
property, or how frequently do they appear on the selected series by using the Chart.setMarkerStep(short)
property.
You can set custom images as chart markers by setting this property to the 'Picture' enumeration and setting an image using the PointAttributes.setPicture(java.awt.Image)
property.
PointAttributes.setMarkerSize(short)
,
Chart.setMarkerStep(short)
,
Chart.setPointFont(java.awt.Font)
,
Chart.setGallery(int)
,
Chart
,
SeriesAttributes
public void setMarkerSize(short value)
Controls the size of the markers for the selected item.
This property sets the radius of the marker in physical units (pixels). You must make sure the PointAttributes.setMarkerShape(int)
Property is set to a valid point type (other than None), before setting this property.
Point markers will not be shown in 3D line charts.
You can control the shape (or type) of the points with the PointAttributes.setMarkerShape(int)
property, or how frequently do they appear on the selected series by using the setMarkerStep(short)
property.
PointAttributes.setMarkerShape(int)
,
setMarkerStep(short)
,
Chart.setMarkerStep(short)
,
Chart
,
SeriesAttributes
public void setMarkerStep(short value)
Controls how frequently point markers are shown in the selected series.
This property is very useful when the chart contains a large number of points and the point markers disturb the chart's readability. For example, if you are showing 100 points in a line chart, the physical separation (pixels) of them is very small and probably the point markers will make the chart unreadable to the end user. In this case, you can set this property to force Chart FX to show point markers every 20 points.
Point markers will not be shown in 3D line charts.
You must make sure the PointAttributes.setMarkerShape(int)
Property is set to a valid point type (other than None), before setting this property.
You can control the shape and Size of the point markers with the PointAttributes.setMarkerShape(int)
property and PointAttributes.setMarkerSize(short)
properties, respectively.
You can extend the point types available by setting this property to an integer representing the negative ASCII code from any font. By default, Chart FX uses the WingDings font table to handle additional point types. For changing the default font, use the Chart.setPointFont(java.awt.Font)
property.
PointAttributes.setMarkerSize(short)
,
PointAttributes.setMarkerShape(int)
,
Chart.setPointFont(java.awt.Font)
,
Chart
public void setPattern(int value)
Allows you to set a pattern for the selected item.
HatchStyle :
Specifies the different hatch patterns available.Value | Description |
BACKWARD_DIAGONAL | A pattern of lines on a diagonal from upper right to lower left. |
CROSS | Specifies horizontal and vertical lines that cross. |
DARK_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, are spaced 50 percent closer together than, and are twice the width of ForwardDiagonal. This hatch pattern is not antialiased. |
DARK_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal and are twice the width of HatchStyleHorizontal. |
DARK_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, are spaced 50 percent closer together than BackwardDiagonal, and are twice its width, but the lines are not antialiased. |
DARK_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical and are twice its width. |
DASHED_DOWNWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the right from top points to bottom points. |
DASHED_HORIZONTAL | Specifies dashed horizontal lines. |
DASHED_UPWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the left from top points to bottom points. |
DASHED_VERTICAL | Specifies dashed vertical lines. |
DIAGONAL_BRICK | Specifies a hatch that has the appearance of layered bricks that slant to the left from top points to bottom points. |
DIAGONAL_CROSS | Specifies forward diagonal and backward diagonal lines that cross. The lines are antialiased. |
DIVOT | Specifies a hatch that has the appearance of divots. |
DOTTED_DIAMOND | Specifies forward diagonal and backward diagonal lines, each of which is composed of dots, that cross. |
DOTTED_GRID | Specifies horizontal and vertical lines, each of which is composed of dots, that cross. |
FORWARD_DIAGONAL | A pattern of lines on a diagonal from upper left to lower right. |
HORIZONTAL | A pattern of horizontal lines. |
HORIZONTAL_BRICK | Specifies a hatch that has the appearance of horizontally layered bricks. |
LARGE_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard with squares that are twice the size of SmallCheckerBoard. |
LARGE_CONFETTI | Specifies a hatch that has the appearance of confetti, and is composed of larger pieces than SmallConfetti. |
LARGE_GRID | Specifies the hatch style Cross. |
LIGHT_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points and are spaced 50 percent closer together than DownwardDiagonal, but they are not antialiased. |
LIGHT_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal. |
LIGHT_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points and are spaced 50 percent closer together than BackwardDiagonal, but they are not antialiased. |
LIGHT_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical. |
MAX | Specifies hatch style SolidDiamond. |
MIN | Specifies hatch style Horizonal. |
NARROW_HORIZONTAL | Specifies horizontal lines that are spaced 75 percent closer together than hatch style Horizontal (or 25 percent closer together than LightHorizontal). |
NARROW_VERTICAL | Specifies vertical lines that are spaced 75 percent closer together than hatch style Vertical (or 25 percent closer together than LightVertical). |
OUTLINED_DIAMOND | Specifies forward diagonal and backward diagonal lines that cross but are not antialiased. |
PERCENT_05 | Specifies a 5-percent hatch. The ratio of foreground color to background color is 5:100. |
PERCENT_10 | Specifies a 10-percent hatch. The ratio of foreground color to background color is 10:100. |
PERCENT_20 | Specifies a 20-percent hatch. The ratio of foreground color to background color is 20:100. |
PERCENT_25 | Specifies a 25-percent hatch. The ratio of foreground color to background color is 25:100. |
PERCENT_30 | Specifies a 30-percent hatch. The ratio of foreground color to background color is 30:100. |
PERCENT_40 | Specifies a 40-percent hatch. The ratio of foreground color to background color is 40:100. |
PERCENT_50 | Specifies a 50-percent hatch. The ratio of foreground color to background color is 50:100. |
PERCENT_60 | Specifies a 60-percent hatch. The ratio of foreground color to background color is 60:100. |
PERCENT_70 | Specifies a 70-percent hatch. The ratio of foreground color to background color is 70:100. |
PERCENT_75 | Specifies a 75-percent hatch. The ratio of foreground color to background color is 75:100. |
PERCENT_80 | Specifies a 80-percent hatch. The ratio of foreground color to background color is 80:100. |
PERCENT_90 | Specifies a 90-percent hatch. The ratio of foreground color to background color is 90:100. |
PLAID | Specifies a hatch that has the appearance of a plaid material. |
SHINGLE | Specifies a hatch that has the appearance of diagonally-layered shingles that slant to the right from top points to bottom points. |
SMALL_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard. |
SMALL_CONFETTI | Specifies a hatch that has the appearance of confetti. |
SMALL_GRID | Specifies horizontal and vertical lines that cross and are spaced 50 percent closer together than hatch style Cross. |
SOLID_DIAMOND | Specifies a hatch that has the appearance of a checkerboard placed diagonally. |
SPHERE | Specifies a hatch that has the appearance of spheres laid adjacent to one another. |
TRELLIS | Specifies a hatch that has the appearance of a trellis. |
VERTICAL | A pattern of vertical lines. |
WAVE | Specifies horizontal lines that are composed of tildes. |
WEAVE | Specifies a hatch that has the appearance of a woven material. |
WIDE_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, have the same spacing as hatch style ForwardDiagonal, and are triple its width, but are not antialiased. |
WIDE_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, have the same spacing as hatch style BackwardDiagonal, and are triple its width, but are not antialiased. |
ZIG_ZAG | Specifies horizontal lines that are composed of zigzags. |
To use this property, you must make sure the chart scheme (PointAttributes.setScheme(int)
property) is set to either B&W or colored patterns.
If the chart's scheme is set to colored patterns you can set both the background and foreground color of the pattern with the setColor(java.awt.Color)
and PointAttributes.setAlternateColor(java.awt.Color)
properties, respectively.
PointAttributes.setScheme(int)
,
setColor(java.awt.Color)
,
PointAttributes.setAlternateColor(java.awt.Color)
,
SeriesAttributes
,
Chart
public void setPicture(java.awt.Image value)
Allows you to set a picture to the selected item.
The Picture property may be used in two different ways depending on the chart's gallery and scheme:
1. If the chart gallery is one that uses point markers, meaning you can set the shape of the marker using the MarkerShape property, then the configured image will be used as a point marker as long as the PointAttributes.setMarkerShape(int)
for that point is set to MarkerShape.Picture.
2. If the chart gallery is one that uses bars, area markers or pie slices (Bar, Area or Pie type charts), the image will be tiled in the selected series or point. However, in order for the tiled effect to be applied you must set the PointAttributes.setScheme(int)
to Scheme.Pattern.
The Legends and DataEditor will also show the picture but with an appropriated size. Notice that if you do not set the PointAttributes.setScheme(int)
to Scheme.Pattern, the configured picture will only be used with charts that have point markers.
When this property is set to a 3D chart, the sides of the markers (3D perspective) are painted with the configured series color.
For more information regarding the Image type, please refer to the Java API Documentation.
setGallery(int)
,
SeriesAttributes
public void setPointLabelAlign(int value)
Allows you to align point labels using the marker as a reference for the selected item.
LabelAlign :
Define the ways of aligning point labels using the marker as a reference. Value | Description |
LEFT | The label will be left aligned to the marker. |
CENTER | The label will be centered with the marker. |
RIGHT | The label will be right aligned to the marker. |
TOP | The label will be on the top edge of the marker. |
VCENTER | The label will be vertically centered. |
BOTTOM | The label will be on the bottom edge of the marker. |
The right way of setting this property is to chose a horizontal and vertical alignment styles and combined them using the Or (bitwise) operator, as follows:
chart1.getPoint(0, 0).setPointLabelAlign(LabelAlign.LEFT | LabelAlign.TOP);
To use this property, you must make sure the point labels are visible (PointAttributes.setPointLabels(boolean)
property).
Although you can set a general alignment for labels showing data values, Chart FX may overwrite such setting to avoid an undesired display of the point label. For example, if you have negative values in the chart, Chart FX will overwrite the Centered-Bottom alignment to a Centered-Top alignment so the label will show properly for points having negative values.
You can also control the label angle with the PointAttributes.setPointLabelAngle(short)
property.
To set the font associated with the selected point label, please refer to the PointAttributes.setPointLabelFont(java.awt.Font)
property.
To set the font color associated with the point labels please refer to the PointAttributes.setPointLabelColor(java.awt.Color)
property.
PointAttributes.setPointLabelColor(java.awt.Color)
,
PointAttributes.setPointLabelFont(java.awt.Font)
,
PointAttributes.setPointLabels(boolean)
,
PointAttributes.setPointLabelAngle(short)
,
Chart
,
SeriesAttributes
public void setPointLabelAngle(short value)
Allows you to display the point label at the specified angle for the selected item.
The PointAttributes.setPointLabels(boolean)
must be visible in order to view the label angle configured.
You can also control the text alignment with the PointAttributes.setPointLabelAlign(int)
property.
The font for a selected item may be customized using the PointAttributes.setPointLabelFont(java.awt.Font)
property.
Use a positive number to rotate the labels from lower left to upper right. Use negative degrees to rotate text from upper left to lower right. (Range [-90,90])
PointAttributes.setPointLabelFont(java.awt.Font)
,
PointAttributes.setPointLabelAlign(int)
,
PointAttributes.setPointLabels(boolean)
,
Chart
,
SeriesAttributes
public void setPointLabelColor(java.awt.Color value)
Allows you to change the color of point labels for the selected item.
The Chart.setPointLabels(boolean)
property must first be set to True in order to view the color of the point label.
It is recommended to use light point label colors when the Chart.setInsideColor(java.awt.Color)
or a series of a Bar chart is a dark color (and, vice versa).
The Chart.setPointLabelColor(java.awt.Color)
property is a global property to change the color for all point labels.
You may modify the font of the selected item using the PointAttributes.setPointLabelFont(java.awt.Font)
property.
For more information regarding the Color type, please refer to the Java API Documentation.
Chart.setPointLabels(boolean)
,
Chart.setInsideColor(java.awt.Color)
,
Chart.setPointLabelColor(java.awt.Color)
,
PointAttributes.setPointLabelFont(java.awt.Font)
,
Chart
public void setPointLabelFont(java.awt.Font value)
Allows you to change the text font attributes for the point labels of the selected item.
When setting a font in Chart FX, you must create a new font object with the desired attributes and assign that object to the desired chart element every time you want to change the font.
You can set the color for a selected point label using the PointAttributes.setPointLabelColor(java.awt.Color)
property.
The Chart.setPointLabels(boolean)
property must first be set to True in order to view the font of the point label.
For more information regarding the Font type, please refer to the Java API Documentation.
Chart.setPointLabels(boolean)
,
PointAttributes.setPointLabelColor(java.awt.Color)
,
Chart.setFont(java.awt.Font)
,
Chart
public void setPointLabels(boolean value)
Allows you to display the value via point label for a selected item.
You can also control the text alignment and text display angle with the PointAttributes.setPointLabelAlign(int)
and PointAttributes.setPointLabelAngle(short)
properties, respectively.
You can modify the font of the selected point label using the PointAttributes.setPointLabelFont(java.awt.Font)
property.
PointAttributes.setPointLabelAlign(int)
,
PointAttributes.setPointLabelAngle(short)
,
PointAttributes.setPointLabelFont(java.awt.Font)
,
SeriesAttributes
public void setScheme(int value)
Allows you to change the color scheme for a selected item.
Scheme :
Define color scheme in the chart. Value | Description |
SOLID | Use solid colors. |
BW_PATTERN | Use Black & White patterns. |
PATTERN | Use colored patterns. |
GRADIENT | Use Gradient when painting the chart series |
The difference between patterns and hatched patterns is that hatched patterns are defined by windows and they can be resized when printing the charts. However, there are limited hatched patterns available.
The Chart FX patternbar uses patterns (not hatched) that are suitable for the screen but when they are printed, they are defined as 8x8 pixels and therefore they will not be visible when printing with high resolution printer (i.e. 600 dpi). The Printer.setForceColors(boolean)
property in the printer object uses hatched patterns to print the charts.
A general rule of thumb is to use patterns for the screen and hatched patterns when printing the chart.
When creating gradients on point markers, the Scheme must be set to Gradient. The setColor(java.awt.Color)
and PointAttributes.setAlternateColor(java.awt.Color)
properties can be set to create the desired gradient colors.
PointAttributes.setAlternateColor(java.awt.Color)
,
PointAttributes.setPattern(int)
,
setColor(java.awt.Color)
,
Chart.setScheme(int)
,
Chart
,
SeriesAttributes
public void setSeparateSlice(short value)
Allows you to separate a slice of a Pie or Doughnut chart for a selected item.
Setting this property to 100 will make the vertex of the slice to be on the edge of the pie.
Chart FX does not provide administrative properties, such as the biggest slice in a PIE chart, so if you want to separate a particular slice based on a certain condition, you must first determine the slice to be separated based on the data contained in the chart.
Chart.setGallery(int)
,
setGallery(int)
,
Chart
public void setSmoothFlags(int value)
Sets the rendering quality for the selected series and text related to this series.
SmoothFlags :
Sets the rendering qualityValue | Description |
FILL | Specifies antialiased rendering inside of the chart. |
BORDER | Specifies antialiased rendering on chart borders. |
TEXT | Specifies that each character is antialiased rendering. |
NONE | Specifies no antialiasing. |
TEXT_SYSTEM | Specifies to use the system settings. |
To change the chart rendering quality use directly the chart Chart.setSmoothFlags(int)
property.
Chart.setSmoothFlags(int)
,
Chart
public void setStacked(boolean value)
Allows you to stack the selected series with the previous series to achieve multi-stacked charts.
Stacked options apply only to Bar and Area charts. So before applying this property, you must make sure the previous series and the selected series are of the same type (Bar or Area).
You can also use the Chart.setStacked(int)
property of the Chart
object to assign the attribute to all series.
Chart.setStacked(int)
,
Chart
public void setTag(java.lang.Object value)
Assign a string to any item for retrieval later.
This string can be viewed when the mouse is placed over a point in a series using the Chart.setShowTips(boolean)
property.
The Chart.setPointLabelMask(java.lang.String)
and Chart.setTipMask(java.lang.String)
properties have a format called %L to display the Tag if exists.
Chart.setShowTips(boolean)
,
Chart.setPointLabelMask(java.lang.String)
,
Chart.setTipMask(java.lang.String)
,
Chart
public void setTypeMask(int value)
Allows you to set additional attributes to the selected item.
ChartType :
Define additional visual attributes in the chart and allows to turn on/off them. Value | Description |
PAINT_MARKER | This constant will turn on message event for customize chart drawing process. |
COLOR_LINE | This constant specifies that the lines of a 2D Line Chart must be drawn using colors. |
SHOW_3D | See Chart3D. |
HORZ | See Gallery. |
TOOL | See Toolbar. |
PALETTE | See PaletteBar. |
LEGEND | See LegendBox. |
HIDE_SERIES | This constant will hide all chart series. |
EACH_BAR | See MultipleColors. |
CLUSTER | See Cluster. |
SHOW_DATA | See DataEditor. |
EDITOR | This constant will show the Data Editor. See DataEditor. |
DLG_GRAY | This constant will cause the dialogs to be shown with a gray background, to provide support for applications that also use gray backgrounds. This keeps the graphics library consistent with the rest of the client application. |
PATTERN | See PatternBar. |
SHOW_VALUES | See PointLabels. |
POINT_LABELS | This constant will show the point markers on a Line or Spline Chart. |
MENU | See MenuBar. |
DEFAULT | See property default. |
INTERNAL_BORDER | This constant will show an internal border for supported Chart FX tools in the chart area. |
NO_BORDERS | See Border. |
PIE_VALUES | This constant specifies that the values must be painted in the pie chart (instead of painting the percentages). |
TRACK_MOUSE | This constant has to be included for those charts you want to capture mouse tracking. |
EVEN_SPACING | This constant specifies points in the x axis will be even spaced, which means that points will be equally distanced in the x axis. When apply, this can cause a behavior in which you will see a blank gap at the right side of the chart, since the points can not be equally distance. Useful with real-time charts. (Default = Off) |
SER_LEGEND | See SerLegBox. |
GLOBAL | Internal use. Refers all enumerations that effect the chart globally, not by point or series. |
USER_LEGEND | Shows or Hides the user legend box in the chart. See UserLegendBox. |
Some of the available flags in this property are supported by individual properties of the object which will apply changes to the selected item. If you want to apply some flags to the entire chart, please refer to the chart's Chart.setTypeEx(int)
Property.
This property is a mask property. this means all settings represent a bit in the word that you need to turn on or off according to what you want. For this purpose you will use the bitwise operators (And, Or, Not, Xor) provided by your development tool. Because it is a mask property, you must make sure you use these operators to turn on/off bits and avoid losing previous settings to the property.For example if you want to include the NoBorders setting, the right way of setting this property is:
chart1.getPoint(0,0).setTypeMask(chart1.getPoint(0,0).getTypeMask() | TypeMask.NO_BORDERS);
(RIGHT!)
If you type the following code:
chart1.getPoint(0,0).setTypeMask(TypeMask.NO_BORDERS);
(WRONG!)
You'll erase all other settings in the property causing an erratic behavior of the library and an incorrect setting of the individual properties which also control these flags.
Chart.setTypeEx(int)
,
Chart.setChartStyle(int)
,
PointAttributes.setPointLabels(boolean)
,
PointAttributes.setBorder(boolean)
,
setVisible(boolean)
,
Chart
,
SeriesAttributes
public void setURL(java.lang.String value)
SeriesAttributes.getLink().setUrl
instead.
getLink()
public void setVisible(boolean value)
Shows or hides the selected series.
Hiding an Series will:
- not recalculate any of the scale values for the axis.
- not remove the data associated with it.
- hide the legend associated with it from the Series Legend.
- hide all the data points in the Data Editor.
If you hide a Series and want Chart FX to recalculate the axis scale values, you must invoke the Chart.recalcScale()
method when you show and/or hide the selected Series.
Chart.recalcScale()
,
PointAttributes
public void setVolume(short value)
Allows you to specify a volume for a data point markers in supported galleries. By adjusting the volume, you can modify the amount of space you want between the items.
The larger the value, the lesser the distance between the selected point and its neighbors.
This property has a dual functionality depending on the clustered status of the chart, as follows:
If the chart is clustered, this property is used to specify the amount of space between the selected point and its neighbors in the z-axis (a.k.a. Gap Depth). When used in this context, this property is used for any chart type that supports clustered options (Including Multi-Type charts)
When the chart is not clustered, this property controls the amount of space between the selected point and its neighbors in the x-axis (a.k.a. Gap Width). When used in this context, this property applies to any chart type that allows side to side positioning of the series (BAR, BUBBLE, CANDLESTICK, HI-LO-CLOSE, OPEN-HI-LOW-CLOSE and CUBES).
If you want to control the Volume property for all the series in the chart (i.e. apply the same volume setting to all of them) you can use the chart class Chart.setVolume(short)
property.
Chart.setGallery(int)
,
Chart.setVolume(short)
,
setGallery(int)
,
Chart
,
SeriesAttributes
public void setYAxis(int value)
Allows you to move (or assign) the selected data series to a different numerical axis.
YAxis :
Defines the main or secondary Y Axis when assigning series to a selected Y axis.Value | Description |
MAIN | Main Y axis. |
SECONDARY | Secondary Y axis. |
Chart FX supports two Y axes with different and independent scales, you can use this property to associate data series with any of these axis. A typical example of a double Y axis chart is a financial (volume) chart, where the price of the stock ranges from 70-90 and the volume traded ranges from 500.000 to 2.000.000. Obviously, when you attempt to plot both series in the same chart, the scale needed in one axis to plot both series will not produce desirable results. In this case, you'll use this property to associate the stock price data series with the primary Y axis (ranging from 70-90) and the volume traded series with a secondary Y axis (ranging from 0 to 2.000.000).
When assigning a series to a Secondary Y axis you should make sure that you make the axis assignment before passing data. By doing this, Chart FX will calculate the Axis.setMax(double)
, Axis.setMin(double)
and Axis.setStep(double)
for the secondary Y axis automatically. If the axis assignment is done after the data has been passed, you can set the Max, Min and Step manually or call the Chart.recalcScale()
method. Please keep in mind that calling the RecalcScale method is a less efficient way to create the chart.
Once you have set a specific data series to a chart, you can customize the axis settings using any of the properties supported by the Axis
Object.
Chart.getAxis(int)
,
Chart.getAxisX()
,
Chart.getAxisY()
,
Axis.setMax(double)
,
Axis.setMin(double)
,
Axis.setStep(double)
,
Chart.recalcScale()
,
Axis
,
Chart
|
http://www.softwarefx.com | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |