public final class Radar extends java.lang.Object implements IExtension, IGallery
Provides access to the Radar gallery object.
The radar chart is a chart that consists of a sequence of equi-angular spokes, called radii, with each spoke representing one of the variables. The data length of a spoke is proportional to the magnitude of the variable for the data point relative to the maximum magnitude of the variable across all data points. A line is drawn connecting the data values for each spoke. This gives the plot a star-like appearance and the origin of one of the popular names for this plot.
The methods of the Radar
class allow you to customize the visual attributes of a Radar chart. In order to make the supported members available, you must first set the gallery of the chart to Radar, and cast the setGalleryAttributes
method of the Chart to the Radar
class:
chart1.setGallery(Gallery.RADAR); Radar highLow; highLow = ((Radar)chart1.getGalleryAttributes());
The cast will fail if the gallery is not set to Radar.
Once you have done this, using the newly created object you can assign these special attributes for the Radar gallery type in your chart.
chart1.setGallery(Gallery.RADAR);
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
chart1.getAxisY().setVisible(false);
chart1.getAxisY().getLine().setColor(new java.awt.Color(0, 0, 0, 0));
chart1.getLegendBox().setContentLayout(ContentLayout.CENTER);
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; } }
Constructor and Description |
---|
Radar()
Constructs a newly allocated Radar object
|
Modifier and Type | Method and Description |
---|---|
boolean |
isCircular()
Gets or sets a value specifying to draw the Radar chart in a round or polygonal shape.
|
boolean |
isClockwise()
Gets or sets a value indicating to plot points in a clockwise or counter-clockwise direction.
|
boolean |
isClosed()
Gets or sets a value indicating whether or not to connect the first and last points in a radar chart.
|
boolean |
isFillArea()
Fills the inside area of a Radar chart.
|
boolean |
isShadows()
Gets or sets a value indicating whether or not shadowing is applied for a 2D radar chart.
|
boolean |
isShowLines()
Shows or hides the lines connecting each point in the radar Chart.
|
void |
resetCircular()
Set the property Circular to its default value.
|
void |
resetClockwise()
Set the property Clockwise to its default value.
|
void |
resetClosed()
Set the property Closed to its default value.
|
void |
resetFillArea()
Set the property FillArea to its default value.
|
void |
resetFlags()
Set the property Flags 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 |
setCircular(boolean value)
Gets or sets a value specifying to draw the Radar chart in a round or polygonal shape.
|
void |
setClockwise(boolean value)
Gets or sets a value indicating to plot points in a clockwise or counter-clockwise direction.
|
void |
setClosed(boolean value)
Gets or sets a value indicating whether or not to connect the first and last points in a radar chart.
|
void |
setFillArea(boolean value)
Fills the inside area of a Radar chart.
|
void |
setShadows(boolean value)
Gets or sets a value indicating whether or not shadowing is applied for a 2D radar chart.
|
void |
setShowLines(boolean value)
Shows or hides the lines connecting each point in the radar Chart.
|
public boolean isCircular()
Gets or sets a value specifying to draw the Radar chart in a round or polygonal shape.
When set to false, the radar will contain as many sides as points are present in the chart. The outer boundary of the Radar chart will be a polygon shape.
The isShadows
method may be used to remove the default shadow applied to 2D Radar charts.
The setGalleryAttributes
method of the Chart
class is used to access the GalleryAttributes object for a chart. The Radar object is a GalleryAttributes object.
To configure the Radar chart to have straight outside edges:
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setCircular(true);
resetCircular
public void setCircular(boolean value)
Gets or sets a value specifying to draw the Radar chart in a round or polygonal shape.
When set to false, the radar will contain as many sides as points are present in the chart. The outer boundary of the Radar chart will be a polygon shape.
The isShadows
method may be used to remove the default shadow applied to 2D Radar charts.
The setGalleryAttributes
method of the Chart
class is used to access the GalleryAttributes object for a chart. The Radar object is a GalleryAttributes object.
To configure the Radar chart to have straight outside edges:
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setCircular(true);
value
- resetCircular
public boolean isClockwise()
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setClockwise(false);
resetClockwise
public void setClockwise(boolean value)
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setClockwise(false);
value
- resetClockwise
public boolean isClosed()
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setClosed(false);
resetClosed
public void setClosed(boolean value)
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setClosed(false);
value
- resetClosed
public boolean isFillArea()
Fills the inside area of a Radar chart.
setGalleryAttributes
method of the Chart class.Below, the area of the Radar chart is filled:
chart1.setGallery(Gallery.RADAR);
Radar myRadar;
myRadar = ((Radar)chart1.getGalleryAttributes());
myRadar.setFillArea(true);
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
chart1.getData().setSeries(3);
chart1.getAxisY().setVisible(false);
chart1.getAxisY().getLine().setColor(new java.awt.Color(0, 0, 0, 0));
chart1.getSeries().get(0).setColor(new java.awt.Color(120, chart1.getSeries().get(0).getColor()));
chart1.getSeries().get(1).setColor(new java.awt.Color(120, chart1.getSeries().get(1).getColor()));
chart1.getSeries().get(2).setColor(new java.awt.Color(120, chart1.getSeries().get(2).getColor()));
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; } }
resetFillArea
public void setFillArea(boolean value)
Fills the inside area of a Radar chart.
setGalleryAttributes
method of the Chart class.Below, the area of the Radar chart is filled:
chart1.setGallery(Gallery.RADAR);
Radar myRadar;
myRadar = ((Radar)chart1.getGalleryAttributes());
myRadar.setFillArea(true);
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
chart1.getData().setSeries(3);
chart1.getAxisY().setVisible(false);
chart1.getAxisY().getLine().setColor(new java.awt.Color(0, 0, 0, 0));
chart1.getSeries().get(0).setColor(new java.awt.Color(120, chart1.getSeries().get(0).getColor()));
chart1.getSeries().get(1).setColor(new java.awt.Color(120, chart1.getSeries().get(1).getColor()));
chart1.getSeries().get(2).setColor(new java.awt.Color(120, chart1.getSeries().get(2).getColor()));
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
- resetFillArea
public boolean isShadows()
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setShadows(true);
resetShadows
public void setShadows(boolean value)
chart1.setGallery(Gallery.RADAR); Radar myRadar; myRadar = ((Radar)chart1.getGalleryAttributes()); myRadar.setShadows(true);
value
- resetShadows
public boolean isShowLines()
Shows or hides the lines connecting each point in the radar Chart.
chart1.setGallery(Gallery.RADAR);
Radar myRadar;
myRadar = ((Radar)chart1.getGalleryAttributes());
myRadar.setShowLines(true);
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
chart1.setGallery(Gallery.RADAR);
Radar myRadar;
myRadar = ((Radar)chart1.getGalleryAttributes());
myRadar.setShowLines(false);
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
resetShowLines
public void setShowLines(boolean value)
Shows or hides the lines connecting each point in the radar Chart.
chart1.setGallery(Gallery.RADAR);
Radar myRadar;
myRadar = ((Radar)chart1.getGalleryAttributes());
myRadar.setShowLines(true);
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
chart1.setGallery(Gallery.RADAR);
Radar myRadar;
myRadar = ((Radar)chart1.getGalleryAttributes());
myRadar.setShowLines(false);
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
value
- resetShowLines
public void resetCircular()
isCircular
public void resetClockwise()
isClockwise
public void resetClosed()
isClosed
public void resetFillArea()
isFillArea
public void resetFlags()
public void resetShadows()
isShadows
public void resetShowLines()
isShowLines
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.