public final class Area extends java.lang.Object implements IExtension, IGallery
Provides access to the Area gallery object.
Area charts are essentially bar charts with the discontinuous breaks removed along the horizontal axis. Data is not broken into discrete bars but appears in a continuous ebb and flow as defined against the Y axis. Consequently, area charts are particularly useful for emphasizing the magnitude of change over time. In addition, area charts can be used for the same purposes as bar charts.
The methods of the Area
class allow you to customize the visual attributes of an Area chart. In order to make the supported members available, you must first set the gallery of the chart to Area, and cast the setGalleryAttributes
method of the Chart to the Area
class:
chart1.setGallery(Gallery.AREA); Area area; area = ((Area)chart1.getGalleryAttributes());
The cast will fail if the gallery is not set to Area.
Once you have done this, using the newly created object you can assign these special attributes for the Area gallery type in your chart.
PopulateProductSales(chart1); chart1.setGallery(Gallery.AREA); chart1.getTitles().add(new TitleDockable("Wines Sales by Type"));
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 |
---|
Area()
Constructs a newly allocated Area object
|
Modifier and Type | Method and Description |
---|---|
VectorAreaValue |
getTemplate()
Allows you to set the template that the Area chart will use.
|
java.lang.String |
getTemplateString()
Allows you to set the template that the Area chart will use.
|
VectorAreaTemplate |
getTemplateVectorAreaTemplate()
Allows you to set the template that the Area chart will use.
|
void |
setTemplate(java.lang.String value)
Allows you to set the template that the Area chart will use.
|
void |
setTemplate(VectorAreaTemplate value)
Allows you to set the template that the Area chart will use.
|
void |
setTemplate(VectorAreaValue value)
Allows you to set the template that the Area chart will use.
|
public VectorAreaTemplate getTemplateVectorAreaTemplate()
Allows you to set the template that the Area chart will use.
Chart FX provides many templates to use with the Area charts.
If you do not want to use templates, you can choose the None option.
To set a Template for a Area chart:
Area area; area = ((Area)chart1.getGalleryAttributes()); area.setTemplate(VectorAreaTemplate.Glass);
Below, samples for every template:
public void setTemplate(VectorAreaTemplate value)
Allows you to set the template that the Area chart will use.
Chart FX provides many templates to use with the Area charts.
If you do not want to use templates, you can choose the None option.
To set a Template for a Area chart:
Area area; area = ((Area)chart1.getGalleryAttributes()); area.setTemplate(VectorAreaTemplate.Glass);
Below, samples for every template:
value
- public VectorAreaValue getTemplate()
Allows you to set the template that the Area chart will use.
Chart FX provides many templates to use with the Area charts.
If you do not want to use templates, you can choose the None option.
To set a Template for a Area chart:
Area area; area = ((Area)chart1.getGalleryAttributes()); area.setTemplate(VectorAreaTemplate.Glass);
Below, samples for every template:
public void setTemplate(VectorAreaValue value)
Allows you to set the template that the Area chart will use.
Chart FX provides many templates to use with the Area charts.
If you do not want to use templates, you can choose the None option.
To set a Template for a Area chart:
Area area; area = ((Area)chart1.getGalleryAttributes()); area.setTemplate(VectorAreaTemplate.Glass);
Below, samples for every template:
value
- public java.lang.String getTemplateString()
Allows you to set the template that the Area chart will use.
Chart FX provides many templates to use with the Area charts.
If you do not want to use templates, you can choose the None option.
To set a Template for a Area chart:
Area area; area = ((Area)chart1.getGalleryAttributes()); area.setTemplate(VectorAreaTemplate.Glass);
Below, samples for every template:
public void setTemplate(java.lang.String value)
Allows you to set the template that the Area chart will use.
Chart FX provides many templates to use with the Area charts.
If you do not want to use templates, you can choose the None option.
To set a Template for a Area chart:
Area area; area = ((Area)chart1.getGalleryAttributes()); area.setTemplate(VectorAreaTemplate.Glass);
Below, samples for every template:
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.