public final class ImageBorder extends java.lang.Object implements IBorderAdornment
Provides access to the ImageBorder object.
When thinking about of all the features built into Chart FX geared to enhance the chart's presentation layer, one that stands out are the Image Borders.
Image Borders add the graphic pizzazz required in today's applications.
chart1.setChartBorder(new ImageBorder(ImageBorderType.PULSAR, new java.awt.Color(192,192,192,255))); PopulateProductSales(chart1); chart1.getTitles().add(new TitleDockable("Wine Sales by Type")); chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY);
public static void PopulateProductSales(Chart chart1) { ProductSales[] data = new ProductSales[]{ new ProductSales("Jan", 12560, 23400, 34500), new ProductSales("Feb", 13400, 21000, 38900), new ProductSales("Mar", 16700, 17000, 42100), new ProductSales("Apr", 12000, 19020, 43800), new ProductSales("May", 15800, 26500, 37540), new ProductSales("Jun", 9800, 27800, 32580), new ProductSales("Jul", 17800, 29820, 34000), new ProductSales("Aug", 19800, 17800, 38000), new ProductSales("Sep", 23200, 32000, 41300), new ProductSales("Oct", 16700, 26500, 46590), new ProductSales("Nov", 11800, 23000, 48700), new ProductSales("Dec", 13400, 15400, 49100) }; ObjectProvider objProvider = new ObjectProvider(data); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class ProductSales { public ProductSales(String month, double white, double red, double sparkling) { this.setMonth(month); this.setWhite(white); this.setRed(red); this.setSparkling(sparkling); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private double privateWhite; public final double getWhite() { return privateWhite; } public final void setWhite(double value) { privateWhite = value; } private double privateRed; public final double getRed() { return privateRed; } public final void setRed(double value) { privateRed = value; } private double privateSparkling; public final double getSparkling() { return privateSparkling; } public final void setSparkling(double value) { privateSparkling = value; } }
Use the ImageBorder's methods to configure the Border of the Chart
, as well as the setBorder
of the DockableBar
such as the DataGrid
the LegendBox
, or the setToolBar
.
Please see the setType
method for a complete list of the supported ImageBorder enumerations.
If your looking for the standard border designs, please refer to the SimpleBorder
class. You can also set Vector Borders.
Constructor and Description |
---|
ImageBorder()
Constructs a newly allocated ImageBorder object
|
ImageBorder(ImageBorderType type)
Constructs a newly allocated ImageBorder object
|
ImageBorder(ImageBorderType type,
java.awt.Color color)
Constructs a newly allocated ImageBorder object
|
ImageBorder(java.lang.String fileName)
Constructs a newly allocated ImageBorder object
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Gets or sets the color of the border.
|
ImageBorderType |
getType()
Gets or sets the type for the image border.
|
void |
resetColor()
Set the property Color to its default value.
|
void |
resetType()
Set the property Type to its default value.
|
void |
setColor(java.awt.Color value)
Gets or sets the color of the border.
|
void |
setType(ImageBorderType value)
Gets or sets the type for the image border.
|
public ImageBorder()
public ImageBorder(ImageBorderType type)
type
- public ImageBorder(java.lang.String fileName)
fileName
- public ImageBorder(ImageBorderType type, java.awt.Color color)
type
- color
- public java.awt.Color getColor()
Gets or sets the color of the border.
setPageColor
method can be used to modify the background color of the shaded area around ImageBorders.PopulateProductSales(chart1);
ImageBorder myBorder;
myBorder = new ImageBorder();
myBorder.setType(ImageBorderType.COLONIAL);
myBorder.setColor(new java.awt.Color(255,0,0,255));
chart1.setChartBorder(myBorder);
chart1.getTitles().add(new TitleDockable("Wine Sales by Type"));
chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY);
public static void PopulateProductSales(Chart chart1) { ProductSales[] data = new ProductSales[]{ new ProductSales("Jan", 12560, 23400, 34500), new ProductSales("Feb", 13400, 21000, 38900), new ProductSales("Mar", 16700, 17000, 42100), new ProductSales("Apr", 12000, 19020, 43800), new ProductSales("May", 15800, 26500, 37540), new ProductSales("Jun", 9800, 27800, 32580), new ProductSales("Jul", 17800, 29820, 34000), new ProductSales("Aug", 19800, 17800, 38000), new ProductSales("Sep", 23200, 32000, 41300), new ProductSales("Oct", 16700, 26500, 46590), new ProductSales("Nov", 11800, 23000, 48700), new ProductSales("Dec", 13400, 15400, 49100) }; ObjectProvider objProvider = new ObjectProvider(data); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class ProductSales { public ProductSales(String month, double white, double red, double sparkling) { this.setMonth(month); this.setWhite(white); this.setRed(red); this.setSparkling(sparkling); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private double privateWhite; public final double getWhite() { return privateWhite; } public final void setWhite(double value) { privateWhite = value; } private double privateRed; public final double getRed() { return privateRed; } public final void setRed(double value) { privateRed = value; } private double privateSparkling; public final double getSparkling() { return privateSparkling; } public final void setSparkling(double value) { privateSparkling = value; } }
getColor
in interface IBorderAdornment
resetColor
public void setColor(java.awt.Color value)
Gets or sets the color of the border.
setPageColor
method can be used to modify the background color of the shaded area around ImageBorders.PopulateProductSales(chart1);
ImageBorder myBorder;
myBorder = new ImageBorder();
myBorder.setType(ImageBorderType.COLONIAL);
myBorder.setColor(new java.awt.Color(255,0,0,255));
chart1.setChartBorder(myBorder);
chart1.getTitles().add(new TitleDockable("Wine Sales by Type"));
chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY);
public static void PopulateProductSales(Chart chart1) { ProductSales[] data = new ProductSales[]{ new ProductSales("Jan", 12560, 23400, 34500), new ProductSales("Feb", 13400, 21000, 38900), new ProductSales("Mar", 16700, 17000, 42100), new ProductSales("Apr", 12000, 19020, 43800), new ProductSales("May", 15800, 26500, 37540), new ProductSales("Jun", 9800, 27800, 32580), new ProductSales("Jul", 17800, 29820, 34000), new ProductSales("Aug", 19800, 17800, 38000), new ProductSales("Sep", 23200, 32000, 41300), new ProductSales("Oct", 16700, 26500, 46590), new ProductSales("Nov", 11800, 23000, 48700), new ProductSales("Dec", 13400, 15400, 49100) }; ObjectProvider objProvider = new ObjectProvider(data); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class ProductSales { public ProductSales(String month, double white, double red, double sparkling) { this.setMonth(month); this.setWhite(white); this.setRed(red); this.setSparkling(sparkling); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private double privateWhite; public final double getWhite() { return privateWhite; } public final void setWhite(double value) { privateWhite = value; } private double privateRed; public final double getRed() { return privateRed; } public final void setRed(double value) { privateRed = value; } private double privateSparkling; public final double getSparkling() { return privateSparkling; } public final void setSparkling(double value) { privateSparkling = value; } }
setColor
in interface IBorderAdornment
value
- resetColor
public ImageBorderType getType()
ImageBorder myBorder; myBorder = new ImageBorder(); myBorder.setType(ImageBorderType.EMBOSS); chart1.setChartBorder(myBorder);
resetType
public void setType(ImageBorderType value)
ImageBorder myBorder; myBorder = new ImageBorder(); myBorder.setType(ImageBorderType.EMBOSS); chart1.setChartBorder(myBorder);
value
- resetType
public void resetColor()
setColor
public void resetType()
setType
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.