public final class BorderAttributes
extends java.lang.Object
Provides access to the BorderAttributes object.
The members of the BorderAttributes allow customization of the border for PointAttributes
and SeriesAttributes
.
Some of the configurable attributes for Borders are setColor
, setEffect
, setStyle
, setWidth
, etc.
The border is the line around the point marker. The following example shows a chart with the series' borders set to a width of 3 and colored red:
chart1.getAllSeries().getBorder().setColor(new java.awt.Color(255,0,0,255));
chart1.getAllSeries().getBorder().setWidth((short)3);
PopulateBirthVariation(chart1);
chart1.setGallery(Gallery.BAR);
chart1.getTitles().add(new TitleDockable("Birth Variation by Gender"));
chart1.getAxisY().getTitle().setText("Variation (%)");
public static void PopulateBirthVariation(Chart chart1) { BirthVariation[] variations = new BirthVariation[] { new BirthVariation("2007", 4.5, 4.9 ), new BirthVariation("2008", -1.8, 1.2 ), new BirthVariation("2009", 2.3, -2.6 ), new BirthVariation("2010", 2.0, 3.0), new BirthVariation("2011", -0.5, -1.7 ), new BirthVariation("2012", 3.1, -0.9 ) }; ObjectProvider objProvider = new ObjectProvider(variations); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class BirthVariation { public BirthVariation(String year, double male, double female) { this.setYear(year); this.setMale(male); this.setFemale(female); } private String privateYear; public final String getYear() { return privateYear; } public final void setYear(String value) { privateYear = value; } private double privateMale; public final double getMale() { return privateMale; } public final void setMale(double value) { privateMale = value; } private double privateFemale; public final double getFemale() { return privateFemale; } public final void setFemale(double value) { privateFemale = value; } }
The folowing image shows the same settings applied to an Area chart:
chart1.getAllSeries().getBorder().setColor(new java.awt.Color(255,0,0,255));
chart1.getAllSeries().getBorder().setWidth((short)3);
PopulateBirthVariation_Female(chart1);
chart1.setGallery(Gallery.AREA);
chart1.getTitles().add(new TitleDockable("Female Birth Variation"));
chart1.getAxisY().getTitle().setText("Variation (%)");
chart1.getLegendBox().setVisible(false);
public static void PopulateBirthVariation_Female(Chart chart1) { BirthVariation[] variations = new BirthVariation[] { new BirthVariation("2007", 4.5, 4.9 ), new BirthVariation("2008", -1.8, 1.2 ), new BirthVariation("2009", 2.3, -2.6 ), new BirthVariation("2010", 2.0, 3.0), new BirthVariation("2011", -0.5, -1.7 ), new BirthVariation("2012", 3.1, -0.9 ) }; ObjectProvider objProvider = new ObjectProvider(variations); chart1.getDataSourceSettings().setDataSource(objProvider); // Since not all the fields in the DataSource are required, we must specify the number // of series that will be contained in the chart and perform the corresponding bindings chart1.getData().setSeries(1); NumericDataField numericFieldFemale = new NumericDataField(); numericFieldFemale.setDataPath("Female"); chart1.getDataSourceSettings().getDataFields().add(numericFieldFemale); chart1.getSeries().get(0).getBindings().setY(numericFieldFemale); StringDataField stringFieldMonth = new StringDataField(); stringFieldMonth.setDataPath("Month"); chart1.getDataSourceSettings().getDataFields().add(stringFieldMonth); chart1.getAxisX().getBindings().setLabel(stringFieldMonth); }
public static void PopulateBirthVariation(Chart chart1) { BirthVariation[] variations = new BirthVariation[] { new BirthVariation("2007", 4.5, 4.9 ), new BirthVariation("2008", -1.8, 1.2 ), new BirthVariation("2009", 2.3, -2.6 ), new BirthVariation("2010", 2.0, 3.0), new BirthVariation("2011", -0.5, -1.7 ), new BirthVariation("2012", 3.1, -0.9 ) }; ObjectProvider objProvider = new ObjectProvider(variations); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class BirthVariation { public BirthVariation(String year, double male, double female) { this.setYear(year); this.setMale(male); this.setFemale(female); } private String privateYear; public final String getYear() { return privateYear; } public final void setYear(String value) { privateYear = value; } private double privateMale; public final double getMale() { return privateMale; } public final void setMale(double value) { privateMale = value; } private double privateFemale; public final double getFemale() { return privateFemale; } public final void setFemale(double value) { privateFemale = value; } }
Constructor and Description |
---|
BorderAttributes() |
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Gets or sets the color of the border of a point marker.
|
BorderEffect |
getEffect()
Gets or sets the BorderEffect for the border of a point marker.
|
DashStyle |
getStyle()
Represents the style of the line for the border of a point marker.
|
short |
getWidth()
Gets or sets a value in pixels.
|
boolean |
isBetweenSegments()
Gets or sets a property which makes the border to be shown between segments.
|
boolean |
isUseForLines()
Gets or sets a property which applies the Border Attributes to the lines of a Line Chart.
|
boolean |
isVisible()
Gets or sets a value making the border visible or not.
|
void |
setBetweenSegments(boolean value)
Gets or sets a property which makes the border to be shown between segments.
|
void |
setColor(java.awt.Color value)
Gets or sets the color of the border of a point marker.
|
void |
setEffect(BorderEffect value)
Gets or sets the BorderEffect for the border of a point marker.
|
void |
setStyle(DashStyle value)
Represents the style of the line for the border of a point marker.
|
void |
setUseForLines(boolean value)
Gets or sets a property which applies the Border Attributes to the lines of a Line Chart.
|
void |
setVisible(boolean value)
Gets or sets a value making the border visible or not.
|
void |
setWidth(short value)
Gets or sets a value in pixels.
|
boolean |
shouldSerializeColor()
Description goes here
|
boolean |
shouldSerializeEffect()
Description goes here
|
boolean |
shouldSerializeStyle()
Description goes here
|
boolean |
shouldSerializeVisible()
Description goes here
|
boolean |
shouldSerializeWidth()
Description goes here
|
public boolean isBetweenSegments()
Gets or sets a property which makes the border to be shown between segments.
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
chart1.setGallery(Gallery.AREA);
chart1.getAllSeries().getBorder().setWidth((short)6);
chart1.getAllSeries().getBorder().setBetweenSegments(true);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
public void setBetweenSegments(boolean value)
Gets or sets a property which makes the border to be shown between segments.
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
chart1.setGallery(Gallery.AREA);
chart1.getAllSeries().getBorder().setWidth((short)6);
chart1.getAllSeries().getBorder().setBetweenSegments(true);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
value
- public java.awt.Color getColor()
Gets or sets the color of the border of a point marker.
The setEffect
method must be set to BorderEffect.None for the setColor
method to have any effect on the selected item border.
For more information regarding the Color type, please refer to the Java Documentation.
To set to Red the Border color for all series:
chart1.getAllSeries().getBorder().setColor(new java.awt.Color(255,0,0,255));
To set to Red the Border color for the first point of all series:
chart1.getPoints().get(0).getChartBorder().setColor(new java.awt.Color(255,0,0,255));
public void setColor(java.awt.Color value)
Gets or sets the color of the border of a point marker.
The setEffect
method must be set to BorderEffect.None for the setColor
method to have any effect on the selected item border.
For more information regarding the Color type, please refer to the Java Documentation.
To set to Red the Border color for all series:
chart1.getAllSeries().getBorder().setColor(new java.awt.Color(255,0,0,255));
To set to Red the Border color for the first point of all series:
chart1.getPoints().get(0).getChartBorder().setColor(new java.awt.Color(255,0,0,255));
value
- public BorderEffect getEffect()
Gets or sets the BorderEffect for the border of a point marker.
PopulateCarProduction(chart1); chart1.getTitles().add(new TitleDockable("Vehicles Production by Type")); chart1.setGallery(Gallery.BAR); chart1.getAllSeries().getBorder().setColor(new java.awt.Color(0,0,0,255)); chart1.getAllSeries().getBorder().setEffect(BorderEffect.SHADOW);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
public void setEffect(BorderEffect value)
Gets or sets the BorderEffect for the border of a point marker.
PopulateCarProduction(chart1); chart1.getTitles().add(new TitleDockable("Vehicles Production by Type")); chart1.setGallery(Gallery.BAR); chart1.getAllSeries().getBorder().setColor(new java.awt.Color(0,0,0,255)); chart1.getAllSeries().getBorder().setEffect(BorderEffect.SHADOW);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
value
- public DashStyle getStyle()
Represents the style of the line for the border of a point marker.
To set the Style of the border line to Dash:
chart1.getAllSeries().getBorder().setStyle(DashStyle.DASH);
public void setStyle(DashStyle value)
Represents the style of the line for the border of a point marker.
To set the Style of the border line to Dash:
chart1.getAllSeries().getBorder().setStyle(DashStyle.DASH);
value
- public boolean isUseForLines()
Gets or sets a property which applies the Border Attributes to the lines of a Line Chart.
PopulateProductSales(chart1); chart1.getTitles().add(new TitleDockable("Wine Sales by Type")); chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY); chart1.getAllSeries().getBorder().setWidth((short)3);
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; } }
PopulateProductSales(chart1); chart1.getTitles().add(new TitleDockable("Wine Sales by Type")); chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY); chart1.getAllSeries().getBorder().setUseForLines(true); chart1.getAllSeries().getBorder().setWidth((short)8);
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; } }
public void setUseForLines(boolean value)
Gets or sets a property which applies the Border Attributes to the lines of a Line Chart.
PopulateProductSales(chart1); chart1.getTitles().add(new TitleDockable("Wine Sales by Type")); chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY); chart1.getAllSeries().getBorder().setWidth((short)3);
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; } }
PopulateProductSales(chart1); chart1.getTitles().add(new TitleDockable("Wine Sales by Type")); chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY); chart1.getAllSeries().getBorder().setUseForLines(true); chart1.getAllSeries().getBorder().setWidth((short)8);
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; } }
value
- public boolean isVisible()
Gets or sets a value making the border visible or not.
A point marker Borders are Visible by default.
To set the border visible for all series:
chart1.getAllSeries().getBorder().setVisible(true);
public void setVisible(boolean value)
Gets or sets a value making the border visible or not.
A point marker Borders are Visible by default.
To set the border visible for all series:
chart1.getAllSeries().getBorder().setVisible(true);
value
- public short getWidth()
Gets or sets a value in pixels.
This method allows you to configure the width for the border of a point marker.
To set the point markers border width to 2:
chart1.getAllSeries().getBorder().setWidth((short)2);
public void setWidth(short value)
Gets or sets a value in pixels.
This method allows you to configure the width for the border of a point marker.
To set the point markers border width to 2:
chart1.getAllSeries().getBorder().setWidth((short)2);
value
- public boolean shouldSerializeColor()
public boolean shouldSerializeEffect()
public boolean shouldSerializeStyle()
public boolean shouldSerializeVisible()
public boolean shouldSerializeWidth()
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.