public final class Line extends java.lang.Object implements IExtension, IGallery
Line charts show trends in data at equal intervals and are effective for comparing highs and lows in a continuum. You can create multiple lines by adding additional data series to the chart. In a 2D line chart additional lines will be drawn in the main chart area and, in the case of 3D line charts, lines could be displayed at the same level or clustered in the Z axis.
The methods of the Line
class allow you to customize the visual attributes of a Line chart. In order to make the supported members available, you must first set the gallery of the chart to Lines, and cast the setGalleryAttributes
method of the Chart to the Line
class:
chart1.setGallery(Gallery.LINES); Line line; line = ((Line)chart1.getGalleryAttributes());
The cast will fail if the gallery is not set to Lines.
Once you have done this, using the newly created object you can assign these special attributes for the Lines gallery type in your chart.
PopulateProductSales(chart1);
chart1.getTitles().add(new TitleDockable("Wine Sales by Type"));
chart1.getAxisY().getLabelsFormat().setFormat(AxisFormat.CURRENCY);
chart1.setGallery(Gallery.LINES);
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; } }
Constructor and Description |
---|
Line()
Constructs a newly allocated Line object
|
Line(boolean singleLineSegment)
Constructs a newly allocated Line object
|
Modifier and Type | Method and Description |
---|---|
VectorLineValue |
getTemplate()
Description goes here
|
java.lang.String |
getTemplateString()
Description goes here
|
VectorLineTemplate |
getTemplateVectorLineTemplate()
Description goes here
|
void |
setTemplate(java.lang.String value)
Description goes here
|
void |
setTemplate(VectorLineTemplate value)
Description goes here
|
void |
setTemplate(VectorLineValue value)
Description goes here
|
public Line()
public Line(boolean singleLineSegment)
singleLineSegment
- public VectorLineTemplate getTemplateVectorLineTemplate()
Description goes here
public void setTemplate(VectorLineTemplate value)
Description goes here
value
- public VectorLineValue getTemplate()
Description goes here
public void setTemplate(VectorLineValue value)
Description goes here
value
- public java.lang.String getTemplateString()
Description goes here
public void setTemplate(java.lang.String value)
Description goes here
value
- 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.