public final class LineAttributes
extends java.lang.Object
Provides access to the LineAttributes object.
The LineAttibutes members allows customization of the lines at the PointAttributes
level. The PointAttributes's setLine
method will provide access to the LineAttributes for each particular point of the chart.
LineAttributes will produce a different effect to the Points in the chart depending of the chart's setGallery
, for example this is how a line chart would be affected:
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
chart1.setGallery(Gallery.LINES);
chart1.getPoints().get(0, 2).getLine().setWidth((short)2);
chart1.getPoints().get(0, 2).getLine().setStyle(DashStyle.DOT);
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; } }
And will have the no effect in a Bar chart:
PopulateSouthAmericaPopulation(chart1);
chart1.getLegendBox().setVisible(false);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getAxisY().setScaleUnit(1000000);
chart1.getAxisY().getTitle().setText("(in Millions)");
chart1.getData().setSeries(1);
chart1.getData().setPoints(8);
chart1.setGallery(Gallery.BAR);
chart1.getPoints().get(0, 0).getLine().setWidth((short)4);
public static void PopulateSouthAmericaPopulation(Chart chart1) { SouthAmericaPopulation[] data = new SouthAmericaPopulation[]{ new SouthAmericaPopulation("Brazil", 201033000), new SouthAmericaPopulation("Colombia", 47130000), new SouthAmericaPopulation("Argentina", 41350000), new SouthAmericaPopulation("Peru", 30476000), new SouthAmericaPopulation("Venezuela", 29760000), new SouthAmericaPopulation("Chile", 16841000), new SouthAmericaPopulation("Ecuador", 15779000), new SouthAmericaPopulation("Bolivia", 10517000) }; ObjectProvider objProvider = new ObjectProvider(data); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class SouthAmericaPopulation { public SouthAmericaPopulation(String country, double population) { this.setCountry(country); this.setPopulation(population); } private String privateCountry; public final String getCountry() { return privateCountry; } public final void setCountry(String value) { privateCountry = value; } private double privatePopulation; public final double getPopulation() { return privatePopulation; } public final void setPopulation(double value) { privatePopulation = value; } }
public static class Countries { public Countries(String country, double lei, double gdppc, java.awt.Image flag) { this.setCountry(country); this.setLEI(lei); this.setGDPPC(gdppc); this.setFlag(flag); } private String privateCountry; public final String getCountry() { return privateCountry; } public final void setCountry(String value) { privateCountry = value; } private double privateLEI; public final double getLEI() { return privateLEI; } public final void setLEI(double value) { privateLEI = value; } private double privateGDPPC; public final double getGDPPC() { return privateGDPPC; } public final void setGDPPC(double value) { privateGDPPC = value; } private java.awt.Image privateFlag; public final java.awt.Image getFlag() { return privateFlag; } public final void setFlag(java.awt.Image value) { privateFlag = value; } }
Constructor and Description |
---|
LineAttributes() |
Modifier and Type | Method and Description |
---|---|
LineCap |
getEndCap()
Gets or sets a marker shape at the end of a PointAttribute's Line.
|
LineCap |
getStartCap()
Gets or sets a marker shape at the start of a PointAttribute's Line.
|
DashStyle |
getStyle()
Gets or sets the style for a PointAttribute's Line.
|
short |
getWidth()
Gets or sets the width for a PointAttribute's Line.
|
void |
setEndCap(LineCap value)
Gets or sets a marker shape at the end of a PointAttribute's Line.
|
void |
setStartCap(LineCap value)
Gets or sets a marker shape at the start of a PointAttribute's Line.
|
void |
setStyle(DashStyle value)
Gets or sets the style for a PointAttribute's Line.
|
void |
setWidth(short value)
Gets or sets the width for a PointAttribute's Line.
|
boolean |
shouldSerializeStyle()
Description goes here
|
boolean |
shouldSerializeWidth()
Description goes here
|
public LineCap getEndCap()
Gets or sets a marker shape at the end of a PointAttribute's Line.
The setLine
method of the PointAttributes
class is used to return a LineAttributes object.
A starting marker shape may be applied to lines using the setStartCap
method.
These are the supported styles:
Text
AnchorMask
Text
ArrowAnchor
Text
Custom
Text
DiamondAnchor
Text
Flat
Text
NoAnchor
Text
Round
Text
RoundAnchor
Text
Square
Text
SquareAnchor
Text
Triangle
To set the EndCap to an Arrow:
chart1.getPoints().get(0, 2).getLine().setEndCap(LineCap.ARROW_ANCHOR);
public void setEndCap(LineCap value)
Gets or sets a marker shape at the end of a PointAttribute's Line.
The setLine
method of the PointAttributes
class is used to return a LineAttributes object.
A starting marker shape may be applied to lines using the setStartCap
method.
These are the supported styles:
Text
AnchorMask
Text
ArrowAnchor
Text
Custom
Text
DiamondAnchor
Text
Flat
Text
NoAnchor
Text
Round
Text
RoundAnchor
Text
Square
Text
SquareAnchor
Text
Triangle
To set the EndCap to an Arrow:
chart1.getPoints().get(0, 2).getLine().setEndCap(LineCap.ARROW_ANCHOR);
value
- public LineCap getStartCap()
Gets or sets a marker shape at the start of a PointAttribute's Line.
The setLine
method of the PointAttributes
class is used to return a LineAttributes object.
An ending marker shape may be applied to lines using the setEndCap
method.
These are the supported styles:
Text
AnchorMask
Text
ArrowAnchor
Text
Custom
Text
DiamondAnchor
Text
Flat
Text
NoAnchor
Text
Round
Text
RoundAnchor
Text
Square
Text
SquareAnchor
Text
Triangle
To set the StartCap to a Square:
chart1.getPoints().get(0, 2).getLine().setStartCap(LineCap.SQUARE_ANCHOR);
public void setStartCap(LineCap value)
Gets or sets a marker shape at the start of a PointAttribute's Line.
The setLine
method of the PointAttributes
class is used to return a LineAttributes object.
An ending marker shape may be applied to lines using the setEndCap
method.
These are the supported styles:
Text
AnchorMask
Text
ArrowAnchor
Text
Custom
Text
DiamondAnchor
Text
Flat
Text
NoAnchor
Text
Round
Text
RoundAnchor
Text
Square
Text
SquareAnchor
Text
Triangle
To set the StartCap to a Square:
chart1.getPoints().get(0, 2).getLine().setStartCap(LineCap.SQUARE_ANCHOR);
value
- public DashStyle getStyle()
Gets or sets the style for a PointAttribute's Line.
setLine
method of the PointAttributes
class is used to return a LineAttributes object.setEndCap
and setStartCap
methods allow you to configured various shapes at the beginning and end of a selected line.setWidth
method gets or sets the width for a PointAttribute's Line.PopulateCarProduction(chart1);
chart1.getPoints().get(0, 2).getLine().setStyle(DashStyle.DASH_DOT_DOT);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
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 setStyle(DashStyle value)
Gets or sets the style for a PointAttribute's Line.
setLine
method of the PointAttributes
class is used to return a LineAttributes object.setEndCap
and setStartCap
methods allow you to configured various shapes at the beginning and end of a selected line.setWidth
method gets or sets the width for a PointAttribute's Line.PopulateCarProduction(chart1);
chart1.getPoints().get(0, 2).getLine().setStyle(DashStyle.DASH_DOT_DOT);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
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 short getWidth()
Gets or sets the width for a PointAttribute's Line.
The setLine
method of the PointAttributes
class is used to return a LineAttributes object.
The setEndCap
and setStartCap
methods allow you to configured various shapes at the beginning and end of a selected line.
The setStyle
method gets or sets the style for a PointAttribute's Line.
To set the line style widht to 4:
chart1.getPoints().get(0, 2).getLine().setWidth((short)4);
public void setWidth(short value)
Gets or sets the width for a PointAttribute's Line.
The setLine
method of the PointAttributes
class is used to return a LineAttributes object.
The setEndCap
and setStartCap
methods allow you to configured various shapes at the beginning and end of a selected line.
The setStyle
method gets or sets the style for a PointAttribute's Line.
To set the line style widht to 4:
chart1.getPoints().get(0, 2).getLine().setWidth((short)4);
value
- public boolean shouldSerializeStyle()
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.