public final class Pie extends java.lang.Object implements IExtension, IGallery
Provides access to the Pie gallery object.
A pie chart is a circular chart divided into sectors, illustrating numerical proportion. In a pie chart, the arc length of each sector (and consequently its central angle and area), is proportional to the quantity it represents. While it is named for its resemblance to a pie which has been sliced, there are variations on the way it can be presented.
The methods of the Pie
class allow you to customize the visual attributes of a Pie chart. In order to make the supported members available, you must first set the gallery of the chart to Pie, and cast the setGalleryAttributes
method of the chart to the Pie
class:
chart1.setGallery(Gallery.PIE); Pie pie; pie = ((Pie)chart1.getGalleryAttributes());
The cast will fail if the gallery is not set to Pie or Doughnut.
Once you have done this, using the newly created object you can assign these special attributes for the Pie or Doughnut gallery type in your chart.
By default, if Chart FX concludes that drawing a label inside a Pie chart will make the readability of the chart harder, this label is drawn outside the chart. You can set LabelsInside to false to force Chart FX to draw all the labels outside the Chart. The following chart illustrates the default behavior of the Pie chart:
PopulateBrowserUsage(chart1);
chart1.getTitles().add(new TitleDockable("Global Browser Usage on August 2013"));
NumericDataField usage;
usage = new NumericDataField();
usage.setDataPath("Usage");
chart1.getDataSourceSettings().getDataFields().add(((DataField)usage));
StringDataField browser;
browser = new StringDataField();
browser.setDataPath("Browser");
chart1.getDataSourceSettings().getDataFields().add(((DataField)browser));
AnalysisDataTransformer adt;
adt = new AnalysisDataTransformer();
adt.getGrouping().add(chart1.getDataSourceSettings().getDataFields().get("Browser"));
chart1.getDataSourceSettings().getTransformers().add(((IDataTransformer)adt));
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
public static void PopulateBrowserUsage(Chart chart1, String fieldNames) { BrowserUsage[] data = new BrowserUsage[] { new BrowserUsage("Chrome", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 41.07 ), new BrowserUsage("Firefox", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 30.75 ), new BrowserUsage("IE", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 21.42 ), new BrowserUsage("Safari", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 3.47 ), new BrowserUsage("Opera", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.52 ), new BrowserUsage("Other", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.77 ), new BrowserUsage("Chrome", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 48.78 ), new BrowserUsage("Firefox", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 16.88 ), new BrowserUsage("IE", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 25.49 ), new BrowserUsage("Safari", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 4 ), new BrowserUsage("Opera", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.02 ), new BrowserUsage("Other", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 3.83 ), new BrowserUsage("Chrome", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 38.52 ), new BrowserUsage("Firefox", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 26.25 ), new BrowserUsage("IE", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 21.37 ), new BrowserUsage("Safari", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 9.19 ), new BrowserUsage("Opera", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.31 ), new BrowserUsage("Other", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.36 ), new BrowserUsage("Chrome", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 36.49 ), new BrowserUsage("Firefox", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 16.24 ), new BrowserUsage("IE", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 30.12 ), new BrowserUsage("Safari", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 14.16 ), new BrowserUsage("Opera", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 0.47 ), new BrowserUsage("Other", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.52 ), new BrowserUsage("Chrome", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 35.02 ), new BrowserUsage("Firefox", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 18.9 ), new BrowserUsage("IE", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 27.82 ), new BrowserUsage("Safari", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 16.31 ), new BrowserUsage("Opera", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 0.45 ), new BrowserUsage("Other", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.5 ), new BrowserUsage("Chrome", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 63.18 ), new BrowserUsage("Firefox", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 15.26 ), new BrowserUsage("IE", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 17.48 ), new BrowserUsage("Safari", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.39 ), new BrowserUsage("Opera", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 0.55 ), new BrowserUsage("Other", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.14 ) }; ObjectProvider objProvider = new ObjectProvider(data); chart1.getDataSourceSettings().setDataSource(objProvider); if (fieldNames != "") { List<DataField> removeFields = new ArrayList<DataField>(); List<String> includeFields = Arrays.asList(fieldNames.split(",")); chart1.getDataSourceSettings().fillFromSchema(); for (DataField dataField : chart1.getDataSourceSettings().getDataFields()) { if (dataField.isMeasure() && !includeFields.contains(dataField.getDataPath())) { removeFields.add(dataField); } } for (DataField dataField : removeFields) { chart1.getDataSourceSettings().getDataFields().remove(dataField); } } } public static void PopulateBrowserUsage(Chart chart1) { PopulateBrowserUsage(chart1,""); }
public static class BrowserUsage { public BrowserUsage(String browser, String region, java.util.Date usageDate, double usage) { this.setBrowser(browser); this.setRegion(region); this.setUsageDate(usageDate); this.setUsage(usage); } private String privateBrowser; public final String getBrowser() { return privateBrowser; } public final void setBrowser(String value) { privateBrowser = value; } private String privateRegion; public final String getRegion() { return privateRegion; } public final void setRegion(String value) { privateRegion = value; } private java.util.Date privateUsageDate = new java.util.Date(0); public final java.util.Date getUsageDate() { return privateUsageDate; } public final void setUsageDate(java.util.Date value) { privateUsageDate = value; } private double privateUsage; public final double getUsage() { return privateUsage; } public final void setUsage(double value) { privateUsage = value; } }
The gallery of the chart can also be set to a Doughnut. The attributes object of the Doughnut gallery is of type Pie:
PopulateBrowserUsage(chart1);
chart1.getTitles().add(new TitleDockable("Global Browser Usage on August 2013"));
NumericDataField usage;
usage = new NumericDataField();
usage.setDataPath("Usage");
chart1.getDataSourceSettings().getDataFields().add(((DataField)usage));
StringDataField browser;
browser = new StringDataField();
browser.setDataPath("Browser");
chart1.getDataSourceSettings().getDataFields().add(((DataField)browser));
AnalysisDataTransformer adt;
adt = new AnalysisDataTransformer();
adt.getGrouping().add(chart1.getDataSourceSettings().getDataFields().get("Browser"));
chart1.getDataSourceSettings().getTransformers().add(((IDataTransformer)adt));
chart1.setGallery(Gallery.DOUGHNUT);
chart1.getAllSeries().getPointLabels().setVisible(true);
public static void PopulateBrowserUsage(Chart chart1, String fieldNames) { BrowserUsage[] data = new BrowserUsage[] { new BrowserUsage("Chrome", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 41.07 ), new BrowserUsage("Firefox", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 30.75 ), new BrowserUsage("IE", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 21.42 ), new BrowserUsage("Safari", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 3.47 ), new BrowserUsage("Opera", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.52 ), new BrowserUsage("Other", "Africa", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.77 ), new BrowserUsage("Chrome", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 48.78 ), new BrowserUsage("Firefox", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 16.88 ), new BrowserUsage("IE", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 25.49 ), new BrowserUsage("Safari", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 4 ), new BrowserUsage("Opera", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.02 ), new BrowserUsage("Other", "Asia", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 3.83 ), new BrowserUsage("Chrome", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 38.52 ), new BrowserUsage("Firefox", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 26.25 ), new BrowserUsage("IE", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 21.37 ), new BrowserUsage("Safari", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 9.19 ), new BrowserUsage("Opera", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.31 ), new BrowserUsage("Other", "Europe", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.36 ), new BrowserUsage("Chrome", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 36.49 ), new BrowserUsage("Firefox", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 16.24 ), new BrowserUsage("IE", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 30.12 ), new BrowserUsage("Safari", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 14.16 ), new BrowserUsage("Opera", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 0.47 ), new BrowserUsage("Other", "North America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.52 ), new BrowserUsage("Chrome", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 35.02 ), new BrowserUsage("Firefox", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 18.9 ), new BrowserUsage("IE", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 27.82 ), new BrowserUsage("Safari", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 16.31 ), new BrowserUsage("Opera", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 0.45 ), new BrowserUsage("Other", "Oceania", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.5 ), new BrowserUsage("Chrome", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 63.18 ), new BrowserUsage("Firefox", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 15.26 ), new BrowserUsage("IE", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 17.48 ), new BrowserUsage("Safari", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 2.39 ), new BrowserUsage("Opera", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 0.55 ), new BrowserUsage("Other", "South America", new java.util.GregorianCalendar(2013, 8, 1).getTime(), 1.14 ) }; ObjectProvider objProvider = new ObjectProvider(data); chart1.getDataSourceSettings().setDataSource(objProvider); if (fieldNames != "") { List<DataField> removeFields = new ArrayList<DataField>(); List<String> includeFields = Arrays.asList(fieldNames.split(",")); chart1.getDataSourceSettings().fillFromSchema(); for (DataField dataField : chart1.getDataSourceSettings().getDataFields()) { if (dataField.isMeasure() && !includeFields.contains(dataField.getDataPath())) { removeFields.add(dataField); } } for (DataField dataField : removeFields) { chart1.getDataSourceSettings().getDataFields().remove(dataField); } } } public static void PopulateBrowserUsage(Chart chart1) { PopulateBrowserUsage(chart1,""); }
public static class BrowserUsage { public BrowserUsage(String browser, String region, java.util.Date usageDate, double usage) { this.setBrowser(browser); this.setRegion(region); this.setUsageDate(usageDate); this.setUsage(usage); } private String privateBrowser; public final String getBrowser() { return privateBrowser; } public final void setBrowser(String value) { privateBrowser = value; } private String privateRegion; public final String getRegion() { return privateRegion; } public final void setRegion(String value) { privateRegion = value; } private java.util.Date privateUsageDate = new java.util.Date(0); public final java.util.Date getUsageDate() { return privateUsageDate; } public final void setUsageDate(java.util.Date value) { privateUsageDate = value; } private double privateUsage; public final double getUsage() { return privateUsage; } public final void setUsage(double value) { privateUsage = value; } }
Constructor and Description |
---|
Pie()
Constructs a newly allocated Pie object
|
Modifier and Type | Method and Description |
---|---|
int |
getDoughnutThickness()
Controls the thickness of the doughnut as a percentage of the outside radius.
|
ExplodingMode |
getExplodingMode()
Allows you to set how the slices of a pie chart are displayed.
|
int |
getLabelLineBreak()
Controls the line that connects the labels with its Pie/Doughnut slice.
|
int |
getMaximumLabelMargin()
Gets or sets the maximum margin (in pixels) allowed between the labels and the borders of the pie chart.
|
int |
getSliceSeparation()
Gets or sets the pie slice separation (in pixels) when using the ExplodingMode property.
|
int |
getStartAngle()
Gets or sets a value specifying the starting angle of the first slice in a pie chart.
|
VectorPieValue |
getTemplate()
Description goes here
|
java.lang.String |
getTemplateString()
Description goes here
|
VectorPieTemplate |
getTemplateVectorPieTemplate()
Description goes here
|
boolean |
isLabelsInside()
Instructs ChartFX to try to paint the point labels directly on the corresponding slice of a Pie chart.
|
boolean |
isShowLines()
Shows or hides lines which connect the point labels to a Pie chart.
|
boolean |
isSquare()
Forces Pie charts to be contained in a perfect square (no matter the window proportion).
|
boolean |
isStacked()
Gets or sets a Boolean value specifying whether or not to stack a pie/doughnut chart.
|
void |
resetDoughnutThickness()
Set the property DoughnutThickness to its default value.
|
void |
resetExplodingMode()
Set the property ExplodingMode to its default value.
|
void |
resetFlags()
Set the property Flags to its default value.
|
void |
resetLabelLineBreak()
Set the property LabelLineBreak to its default value.
|
void |
resetLabelsInside()
Set the property LabelsInside to its default value.
|
void |
resetMaximumLabelMargin()
Set the property MaximumLabelMargin to its default value.
|
void |
resetShadows()
Set the property Shadows to its default value.
|
void |
resetShowLines()
Set the property ShowLines to its default value.
|
void |
resetSliceSeparation()
Set the property SliceSeparation to its default value.
|
void |
resetSquare()
Set the property Square to its default value.
|
void |
resetStacked()
Set the property Stacked to its default value.
|
void |
resetStartAngle()
Set the property StartAngle to its default value.
|
void |
resetTemplate()
Set the property Template to its default value.
|
void |
setDoughnutThickness(int value)
Controls the thickness of the doughnut as a percentage of the outside radius.
|
void |
setExplodingMode(ExplodingMode value)
Allows you to set how the slices of a pie chart are displayed.
|
void |
setLabelLineBreak(int value)
Controls the line that connects the labels with its Pie/Doughnut slice.
|
void |
setLabelsInside(boolean value)
Instructs ChartFX to try to paint the point labels directly on the corresponding slice of a Pie chart.
|
void |
setMaximumLabelMargin(int value)
Gets or sets the maximum margin (in pixels) allowed between the labels and the borders of the pie chart.
|
void |
setShowLines(boolean value)
Shows or hides lines which connect the point labels to a Pie chart.
|
void |
setSliceSeparation(int value)
Gets or sets the pie slice separation (in pixels) when using the ExplodingMode property.
|
void |
setSquare(boolean value)
Forces Pie charts to be contained in a perfect square (no matter the window proportion).
|
void |
setStacked(boolean value)
Gets or sets a Boolean value specifying whether or not to stack a pie/doughnut chart.
|
void |
setStartAngle(int value)
Gets or sets a value specifying the starting angle of the first slice in a pie chart.
|
void |
setTemplate(java.lang.String value)
Description goes here
|
void |
setTemplate(VectorPieTemplate value)
Description goes here
|
void |
setTemplate(VectorPieValue value)
Description goes here
|
public int getDoughnutThickness()
Controls the thickness of the doughnut as a percentage of the outside radius.
The default value is 50 which means the radius of the hole is half of the radius of the outer wall. As this value decreases, the doughnut becomes thinner.
When the isStacked
method is set to true, a multi-series pie/doughnut chart will draw each series on top of each other (2D Only) instead of side-by-side.
The setVolume
method may be used to control the size of each series. Series 0 is painted behind the others, so it should be set as the largest (e.g. Volume = 100).
Below is an example of creating a stacked Pie chart:
PopulateCarProduction(chart1);
chart1.setGallery(Gallery.DOUGHNUT);
Pie doughnut;
doughnut = ((Pie)chart1.getGalleryAttributes());
doughnut.setStacked(true);
doughnut.setDoughnutThickness(20);
SeriesAttributes series;
series = chart1.getSeries().get(0);
series.setVolume((short)100);
series = chart1.getSeries().get(1);
series.setVolume((short)75);
series = chart1.getSeries().get(2);
series.setGallery(Gallery.PIE);
series.setVolume((short)55);
chart1.getDataGrid().setVisible(true);
chart1.getDataGrid().setDock(DockArea.RIGHT);
chart1.getDataGrid().setContentLayout(ContentLayout.CENTER);
chart1.getTitles().add(new TitleDockable("Vehicles Production First Semester 2012"));
TitleDockable footer;
footer = new TitleDockable();
footer.setChartFont(new java.awt.Font("Segoe UI",java.awt.Font.PLAIN, 8));
footer.setAlignment(StringAlignment.CENTER);
footer.setPlotAreaOnly(false);
footer.setText("<b>Rings Legend:</b>Outer: Sedan - Center: Coupe - Inner: SUV");
footer.setRichText(true);
footer.setDock(DockArea.BOTTOM);
chart1.getTitles().add(footer);
chart1.getLegendBox().setVisible(false);
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; } }
resetDoughnutThickness
public void setDoughnutThickness(int value)
Controls the thickness of the doughnut as a percentage of the outside radius.
The default value is 50 which means the radius of the hole is half of the radius of the outer wall. As this value decreases, the doughnut becomes thinner.
When the isStacked
method is set to true, a multi-series pie/doughnut chart will draw each series on top of each other (2D Only) instead of side-by-side.
The setVolume
method may be used to control the size of each series. Series 0 is painted behind the others, so it should be set as the largest (e.g. Volume = 100).
Below is an example of creating a stacked Pie chart:
PopulateCarProduction(chart1);
chart1.setGallery(Gallery.DOUGHNUT);
Pie doughnut;
doughnut = ((Pie)chart1.getGalleryAttributes());
doughnut.setStacked(true);
doughnut.setDoughnutThickness(20);
SeriesAttributes series;
series = chart1.getSeries().get(0);
series.setVolume((short)100);
series = chart1.getSeries().get(1);
series.setVolume((short)75);
series = chart1.getSeries().get(2);
series.setGallery(Gallery.PIE);
series.setVolume((short)55);
chart1.getDataGrid().setVisible(true);
chart1.getDataGrid().setDock(DockArea.RIGHT);
chart1.getDataGrid().setContentLayout(ContentLayout.CENTER);
chart1.getTitles().add(new TitleDockable("Vehicles Production First Semester 2012"));
TitleDockable footer;
footer = new TitleDockable();
footer.setChartFont(new java.awt.Font("Segoe UI",java.awt.Font.PLAIN, 8));
footer.setAlignment(StringAlignment.CENTER);
footer.setPlotAreaOnly(false);
footer.setText("<b>Rings Legend:</b>Outer: Sedan - Center: Coupe - Inner: SUV");
footer.setRichText(true);
footer.setDock(DockArea.BOTTOM);
chart1.getTitles().add(footer);
chart1.getLegendBox().setVisible(false);
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
- resetDoughnutThickness
public ExplodingMode getExplodingMode()
Allows you to set how the slices of a pie chart are displayed.
You can set the distance a slice will be separated from the pie chart using the setSliceSeparation
method.
Below, the pie is set to the Full exploding mode:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setExplodingMode(galleries.ExplodingMode.All);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
Alternatively, the Pie chart is here set to the First exploding mode:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setExplodingMode(galleries.ExplodingMode.First);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
resetExplodingMode
public void setExplodingMode(ExplodingMode value)
Allows you to set how the slices of a pie chart are displayed.
You can set the distance a slice will be separated from the pie chart using the setSliceSeparation
method.
Below, the pie is set to the Full exploding mode:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setExplodingMode(galleries.ExplodingMode.All);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
Alternatively, the Pie chart is here set to the First exploding mode:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setExplodingMode(galleries.ExplodingMode.First);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
value
- resetExplodingMode
public int getLabelLineBreak()
Controls the line that connects the labels with its Pie/Doughnut slice. Notice that the LabelsInside property should be set to false.
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setLabelLineBreak(10);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setLabelLineBreak(0);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setLabelLineBreak(20);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
resetLabelLineBreak
public void setLabelLineBreak(int value)
Controls the line that connects the labels with its Pie/Doughnut slice. Notice that the LabelsInside property should be set to false.
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setLabelLineBreak(10);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setLabelLineBreak(0);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setLabelLineBreak(20);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
value
- resetLabelLineBreak
public boolean isLabelsInside()
Instructs ChartFX to try to paint the point labels directly on the corresponding slice of a Pie chart.
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.getAllSeries().getPointLabels().setChartFont(new java.awt.Font("Arial",java.awt.Font.PLAIN, 8));
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(true);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.getAllSeries().getPointLabels().setChartFont(new java.awt.Font("Arial",java.awt.Font.PLAIN, 10));
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(true);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
resetLabelsInside
public void setLabelsInside(boolean value)
Instructs ChartFX to try to paint the point labels directly on the corresponding slice of a Pie chart.
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.getAllSeries().getPointLabels().setChartFont(new java.awt.Font("Arial",java.awt.Font.PLAIN, 8));
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(true);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.getAllSeries().getPointLabels().setChartFont(new java.awt.Font("Arial",java.awt.Font.PLAIN, 10));
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(true);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
value
- resetLabelsInside
public int getMaximumLabelMargin()
Gets or sets the maximum margin (in pixels) allowed between the labels and the borders of the pie chart.
PopulateSouthAmericaPopulation(chart1);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setMaximumLabelMargin(11);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setMaximumLabelMargin(20);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
resetMaximumLabelMargin
public void setMaximumLabelMargin(int value)
Gets or sets the maximum margin (in pixels) allowed between the labels and the borders of the pie chart.
PopulateSouthAmericaPopulation(chart1);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setMaximumLabelMargin(11);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
PopulateSouthAmericaPopulation(chart1);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setLabelsInside(false);
myPie.setMaximumLabelMargin(20);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
value
- resetMaximumLabelMargin
public boolean isShowLines()
Shows or hides lines which connect the point labels to a Pie chart.
When used in conjunction with a Pie chart, this method shows or hides the lines drawn from point labels to their corresponding pie slice. If the labels are inside the pie (i.e., isLabelsInside
= true) , this method will have no effect on the chart.
Below is a Pie chart where the lines are hidden:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setShowLines(false);
myPie.setLabelsInside(false);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
resetShowLines
public void setShowLines(boolean value)
Shows or hides lines which connect the point labels to a Pie chart.
When used in conjunction with a Pie chart, this method shows or hides the lines drawn from point labels to their corresponding pie slice. If the labels are inside the pie (i.e., isLabelsInside
= true) , this method will have no effect on the chart.
Below is a Pie chart where the lines are hidden:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setShowLines(false);
myPie.setLabelsInside(false);
chart1.getAllSeries().getPointLabels().setVisible(true);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
value
- resetShowLines
public int getSliceSeparation()
Gets or sets the pie slice separation (in pixels) when using the ExplodingMode property.
Below is a Pie chart with SliceSeparation equal to 10:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setSliceSeparation(10);
myPie.setExplodingMode(galleries.ExplodingMode.All);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
Below is a Pie chart with SliceSeparation equal to 25:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setSliceSeparation(25);
myPie.setExplodingMode(galleries.ExplodingMode.All);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
resetSliceSeparation
public void setSliceSeparation(int value)
Gets or sets the pie slice separation (in pixels) when using the ExplodingMode property.
Below is a Pie chart with SliceSeparation equal to 10:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setSliceSeparation(10);
myPie.setExplodingMode(galleries.ExplodingMode.All);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
Below is a Pie chart with SliceSeparation equal to 25:
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setSliceSeparation(25);
myPie.setExplodingMode(galleries.ExplodingMode.All);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
value
- resetSliceSeparation
public boolean isSquare()
Forces Pie charts to be contained in a perfect square (no matter the window proportion).
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setSquare(false);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
resetSquare
public void setSquare(boolean value)
Forces Pie charts to be contained in a perfect square (no matter the window proportion).
PopulateSouthAmericaPopulation(chart1);
chart1.setGallery(Gallery.PIE);
Pie myPie;
myPie = ((Pie)chart1.getGalleryAttributes());
myPie.setSquare(false);
chart1.getTitles().add(new TitleDockable("South American Countries Population"));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
value
- resetSquare
public boolean isStacked()
chart1.setGallery(Gallery.PIE); Pie myPie; myPie = ((Pie)chart1.getGalleryAttributes()); myPie.setStacked(true);
resetStacked
public void setStacked(boolean value)
chart1.setGallery(Gallery.PIE); Pie myPie; myPie = ((Pie)chart1.getGalleryAttributes()); myPie.setStacked(true);
value
- resetStacked
public int getStartAngle()
myPie.setStartAngle(180);
resetStartAngle
public void setStartAngle(int value)
myPie.setStartAngle(180);
value
- resetStartAngle
public VectorPieTemplate getTemplateVectorPieTemplate()
Description goes here
resetTemplate
public void setTemplate(VectorPieTemplate value)
Description goes here
value
- resetTemplate
public VectorPieValue getTemplate()
Description goes here
resetTemplate
public void setTemplate(VectorPieValue value)
Description goes here
value
- resetTemplate
public java.lang.String getTemplateString()
Description goes here
resetTemplate
public void setTemplate(java.lang.String value)
Description goes here
value
- resetTemplate
public void resetDoughnutThickness()
setDoughnutThickness
public void resetExplodingMode()
setExplodingMode
public void resetFlags()
public void resetLabelLineBreak()
setLabelLineBreak
public void resetLabelsInside()
isLabelsInside
public void resetMaximumLabelMargin()
setMaximumLabelMargin
public void resetShadows()
public void resetShowLines()
isShowLines
public void resetSliceSeparation()
setSliceSeparation
public void resetSquare()
isSquare
public void resetStacked()
isStacked
public void resetStartAngle()
setStartAngle
public void resetTemplate()
setTemplate
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.