public final class Bubble extends java.lang.Object implements IExtension, IGallery, ILegendBoxItemCollection
Provides access to the Bubble gallery object.
A Bubble chart compares a set of two series. The second series specifies the size of the bubble marker, and the first series specifies the location in the Y-Axis where the bubble center is painted.
The methods of the Bubble
class allow you to customize the visual attributes of a Bubble chart. In order to make the supported members available, you must first set the gallery of the chart to Bubble, and cast the setGalleryAttributes
method of the Chart to the Bubble
class:
chart1.setGallery(Gallery.BUBBLE); Bubble bubble; bubble = ((Bubble)chart1.getGalleryAttributes());
The cast will fail if the gallery is not set to Bubble.
Once you have done this, using the newly created object you can assign these special attributes for the Bubble gallery type in your chart.
When configuring bubble charts, you must be aware that the setVolume
method has a specific effect on the way bubble charts are displayed as the Size will be divided by the setting in the Volume method. For example, if the setVolume
method is set to 50, it means that Chart FX will force the marker to occupy 1/2 of the space allotted. When you set the bubble size to 100, you would expect the bubble to occupy the entire space allotted; however in this case the bubble will only occupy 1/2 of the space allotted. Similarly, if the Volume is set to 50 and the bubble size is 50, the bubble will occupy 1/4 of the space allotted.
chart1.setGallery(Gallery.BUBBLE); PopulateCompanyDataBubble(chart1); chart1.getAllSeries().setVolume((short)500); chart1.getAxisY().getGrids().getMajor().setVisible(false); chart1.getAxisX().getGrids().getMajor().setVisible(false); chart1.getAxisY().setMax(100); chart1.getAxisY().getTitle().setText("Rank"); chart1.getAxisX().getTitle().setText("Relative Strength"); chart1.getLegendBox().setVisible(false);
public static void PopulateCompanyDataBubble(Chart chart1) { CompanyDataBubble[] companyData = new CompanyDataBubble[]{ new CompanyDataBubble("DODC", 0.97, 85, 39), new CompanyDataBubble("HPLA", 0.75, 74, 54), new CompanyDataBubble("FSTW", 0.73, 74, 23), new CompanyDataBubble("HYSL", 0.83, 72, 55), new CompanyDataBubble("COOG", 0.82, 68, 52), new CompanyDataBubble("JDEC", 0.64, 68, 37), new CompanyDataBubble("OTEX", 0.65, 65, 22), new CompanyDataBubble("NTIQ", 0.52, 60, 24), new CompanyDataBubble("OOGN", 0.59, 58, 39), new CompanyDataBubble("ORCL", 0.54, 58, 65), new CompanyDataBubble("SY", 0.71, 58, 7), new CompanyDataBubble("PRGS", 0.69, 57, 19), new CompanyDataBubble("TALX", 0.34, 54, 16), new CompanyDataBubble("TTS", 0.38, 54, 4), new CompanyDataBubble("PRSE", 0.44, 50, 6), new CompanyDataBubble("BCBJ", 0.37, 48, 0), new CompanyDataBubble("DCTM", 0.53, 46, 67), new CompanyDataBubble("ULCM", 0.31, 44, 71), new CompanyDataBubble("MERQ", 0.56, 43, 38), new CompanyDataBubble("ATRS", 0.78, 42, 0), new CompanyDataBubble("JDAS", 0.34, 41, 32), new CompanyDataBubble("SAP", 0.48, 40, 11), new CompanyDataBubble("VRTY", 0.49, 39, 80), new CompanyDataBubble("PSFT", 0.38, 38, 42), new CompanyDataBubble("SRNA", 0.35, 36, 39), new CompanyDataBubble("SPSS", 0.58, 36, 18), new CompanyDataBubble("QSFT", 0.32, 35, 68), new CompanyDataBubble("PTEC", 0.51, 34, 10), new CompanyDataBubble("BMC", 0.58, 32, 37), new CompanyDataBubble("CTXS", 0.16, 32, 9), new CompanyDataBubble("PDFS", 0.22, 31, 18), new CompanyDataBubble("MRCL", 0.3, 30, 22), new CompanyDataBubble("CA", 0.24, 30, 33), new CompanyDataBubble("VRTS", 0.36, 29, 12), new CompanyDataBubble("TIBX", 0.31, 28, 6), new CompanyDataBubble("LTBG", 0.47, 23, 18), new CompanyDataBubble("RATL", 0.26, 23, 23), new CompanyDataBubble("SEBL", 0.23, 19, 15), new CompanyDataBubble("LWSN", 0.27, 16, 13) }; ObjectProvider objProvider = new ObjectProvider(companyData); chart1.getDataSourceSettings().setDataSource(objProvider); DataFieldCollection dataFieldCollection = chart1.getDataSourceSettings().getDataFields(); StringDataField dfSymbol = new StringDataField(); dfSymbol.setDataPath("Symbol"); NumericDataField dfStrength = new NumericDataField(); dfStrength.setDataPath("Strength"); NumericDataField dfRank = new NumericDataField(); dfRank.setDataPath("Rank"); NumericDataField dfPE = new NumericDataField(); dfPE.setDataPath("PE"); dataFieldCollection.add(dfSymbol); dataFieldCollection.add(dfStrength); dataFieldCollection.add(dfRank); dataFieldCollection.add(dfPE); chart1.getData().setSeries(2); SeriesBindings series0Bindings = chart1.getSeries().get(0).getBindings(); SeriesBindings series1Bindings = chart1.getSeries().get(1).getBindings(); series0Bindings.setX(dfStrength); series1Bindings.setX(dfStrength); series0Bindings.setY(dfRank); series1Bindings.setY(dfPE); chart1.getDataSourceSettings().readData(); }
public static class CompanyDataBubble { public CompanyDataBubble(String symbol, double strengh, double rank, double pe) { this.setSymbol(symbol); this.setStrength(strengh); this.setRank(rank); this.setPE(pe); } private String privateSymbol; public final String getSymbol() { return privateSymbol; } public final void setSymbol(String value) { privateSymbol = value; } private double privateStrength; public final double getStrength() { return privateStrength; } public final void setStrength(double value) { privateStrength = value; } private double privateRank; public final double getRank() { return privateRank; } public final void setRank(double value) { privateRank = value; } private double privatePE; public final double getPE() { return privatePE; } public final void setPE(double value) { privatePE = value; } }
Constructor and Description |
---|
Bubble()
Constructs a newly allocated Bubble object
|
Modifier and Type | Method and Description |
---|---|
int |
getMaximumBubbleSize()
Gets or sets the maximum size a bubble can have in the Bubble chart.
|
VectorBubbleValue |
getTemplate()
Description goes here
|
java.lang.String |
getTemplateString()
Description goes here
|
VectorBubbleTemplate |
getTemplateVectorBubbleTemplate()
Description goes here
|
boolean |
isUseArea()
Description goes here
|
void |
resetMaximumBubbleSize()
Set the property MaximumBubbleSize to its default value.
|
void |
resetUseArea()
Set the property UseArea to its default value.
|
void |
setMaximumBubbleSize(int value)
Gets or sets the maximum size a bubble can have in the Bubble chart.
|
void |
setTemplate(java.lang.String value)
Description goes here
|
void |
setTemplate(VectorBubbleTemplate value)
Description goes here
|
void |
setTemplate(VectorBubbleValue value)
Description goes here
|
void |
setUseArea(boolean value)
Description goes here
|
public int getMaximumBubbleSize()
Gets or sets the maximum size a bubble can have in the Bubble chart.
The values are relative; so a MaxSize of 50 shows bubbles smaller than a MaxSize of 100.
There is no limit to the MaxSize, however 100 usually creates a bubble with the size of the chart, and any larger values would simply occupy the chart screen reducing the charts usefulness.
Below, the maximum bubble size is set to 25:
PopulateCompanyDataBubble(chart1);
chart1.setGallery(Gallery.BUBBLE);
Bubble bubble;
bubble = ((Bubble)chart1.getGalleryAttributes());
bubble.setMaximumBubbleSize(25);
chart1.getAxisY().getGrids().getMajor().setVisible(false);
chart1.getAxisY().setMax(100);
chart1.getAxisY().getTitle().setText("Rank");
chart1.getAxisX().getTitle().setText("Relative Strength");
chart1.getLegendBox().setVisible(false);
public static void PopulateCompanyDataBubble(Chart chart1) { CompanyDataBubble[] companyData = new CompanyDataBubble[]{ new CompanyDataBubble("DODC", 0.97, 85, 39), new CompanyDataBubble("HPLA", 0.75, 74, 54), new CompanyDataBubble("FSTW", 0.73, 74, 23), new CompanyDataBubble("HYSL", 0.83, 72, 55), new CompanyDataBubble("COOG", 0.82, 68, 52), new CompanyDataBubble("JDEC", 0.64, 68, 37), new CompanyDataBubble("OTEX", 0.65, 65, 22), new CompanyDataBubble("NTIQ", 0.52, 60, 24), new CompanyDataBubble("OOGN", 0.59, 58, 39), new CompanyDataBubble("ORCL", 0.54, 58, 65), new CompanyDataBubble("SY", 0.71, 58, 7), new CompanyDataBubble("PRGS", 0.69, 57, 19), new CompanyDataBubble("TALX", 0.34, 54, 16), new CompanyDataBubble("TTS", 0.38, 54, 4), new CompanyDataBubble("PRSE", 0.44, 50, 6), new CompanyDataBubble("BCBJ", 0.37, 48, 0), new CompanyDataBubble("DCTM", 0.53, 46, 67), new CompanyDataBubble("ULCM", 0.31, 44, 71), new CompanyDataBubble("MERQ", 0.56, 43, 38), new CompanyDataBubble("ATRS", 0.78, 42, 0), new CompanyDataBubble("JDAS", 0.34, 41, 32), new CompanyDataBubble("SAP", 0.48, 40, 11), new CompanyDataBubble("VRTY", 0.49, 39, 80), new CompanyDataBubble("PSFT", 0.38, 38, 42), new CompanyDataBubble("SRNA", 0.35, 36, 39), new CompanyDataBubble("SPSS", 0.58, 36, 18), new CompanyDataBubble("QSFT", 0.32, 35, 68), new CompanyDataBubble("PTEC", 0.51, 34, 10), new CompanyDataBubble("BMC", 0.58, 32, 37), new CompanyDataBubble("CTXS", 0.16, 32, 9), new CompanyDataBubble("PDFS", 0.22, 31, 18), new CompanyDataBubble("MRCL", 0.3, 30, 22), new CompanyDataBubble("CA", 0.24, 30, 33), new CompanyDataBubble("VRTS", 0.36, 29, 12), new CompanyDataBubble("TIBX", 0.31, 28, 6), new CompanyDataBubble("LTBG", 0.47, 23, 18), new CompanyDataBubble("RATL", 0.26, 23, 23), new CompanyDataBubble("SEBL", 0.23, 19, 15), new CompanyDataBubble("LWSN", 0.27, 16, 13) }; ObjectProvider objProvider = new ObjectProvider(companyData); chart1.getDataSourceSettings().setDataSource(objProvider); DataFieldCollection dataFieldCollection = chart1.getDataSourceSettings().getDataFields(); StringDataField dfSymbol = new StringDataField(); dfSymbol.setDataPath("Symbol"); NumericDataField dfStrength = new NumericDataField(); dfStrength.setDataPath("Strength"); NumericDataField dfRank = new NumericDataField(); dfRank.setDataPath("Rank"); NumericDataField dfPE = new NumericDataField(); dfPE.setDataPath("PE"); dataFieldCollection.add(dfSymbol); dataFieldCollection.add(dfStrength); dataFieldCollection.add(dfRank); dataFieldCollection.add(dfPE); chart1.getData().setSeries(2); SeriesBindings series0Bindings = chart1.getSeries().get(0).getBindings(); SeriesBindings series1Bindings = chart1.getSeries().get(1).getBindings(); series0Bindings.setX(dfStrength); series1Bindings.setX(dfStrength); series0Bindings.setY(dfRank); series1Bindings.setY(dfPE); chart1.getDataSourceSettings().readData(); }
public static class CompanyDataBubble { public CompanyDataBubble(String symbol, double strengh, double rank, double pe) { this.setSymbol(symbol); this.setStrength(strengh); this.setRank(rank); this.setPE(pe); } private String privateSymbol; public final String getSymbol() { return privateSymbol; } public final void setSymbol(String value) { privateSymbol = value; } private double privateStrength; public final double getStrength() { return privateStrength; } public final void setStrength(double value) { privateStrength = value; } private double privateRank; public final double getRank() { return privateRank; } public final void setRank(double value) { privateRank = value; } private double privatePE; public final double getPE() { return privatePE; } public final void setPE(double value) { privatePE = value; } }
resetMaximumBubbleSize
public void setMaximumBubbleSize(int value)
Gets or sets the maximum size a bubble can have in the Bubble chart.
The values are relative; so a MaxSize of 50 shows bubbles smaller than a MaxSize of 100.
There is no limit to the MaxSize, however 100 usually creates a bubble with the size of the chart, and any larger values would simply occupy the chart screen reducing the charts usefulness.
Below, the maximum bubble size is set to 25:
PopulateCompanyDataBubble(chart1);
chart1.setGallery(Gallery.BUBBLE);
Bubble bubble;
bubble = ((Bubble)chart1.getGalleryAttributes());
bubble.setMaximumBubbleSize(25);
chart1.getAxisY().getGrids().getMajor().setVisible(false);
chart1.getAxisY().setMax(100);
chart1.getAxisY().getTitle().setText("Rank");
chart1.getAxisX().getTitle().setText("Relative Strength");
chart1.getLegendBox().setVisible(false);
public static void PopulateCompanyDataBubble(Chart chart1) { CompanyDataBubble[] companyData = new CompanyDataBubble[]{ new CompanyDataBubble("DODC", 0.97, 85, 39), new CompanyDataBubble("HPLA", 0.75, 74, 54), new CompanyDataBubble("FSTW", 0.73, 74, 23), new CompanyDataBubble("HYSL", 0.83, 72, 55), new CompanyDataBubble("COOG", 0.82, 68, 52), new CompanyDataBubble("JDEC", 0.64, 68, 37), new CompanyDataBubble("OTEX", 0.65, 65, 22), new CompanyDataBubble("NTIQ", 0.52, 60, 24), new CompanyDataBubble("OOGN", 0.59, 58, 39), new CompanyDataBubble("ORCL", 0.54, 58, 65), new CompanyDataBubble("SY", 0.71, 58, 7), new CompanyDataBubble("PRGS", 0.69, 57, 19), new CompanyDataBubble("TALX", 0.34, 54, 16), new CompanyDataBubble("TTS", 0.38, 54, 4), new CompanyDataBubble("PRSE", 0.44, 50, 6), new CompanyDataBubble("BCBJ", 0.37, 48, 0), new CompanyDataBubble("DCTM", 0.53, 46, 67), new CompanyDataBubble("ULCM", 0.31, 44, 71), new CompanyDataBubble("MERQ", 0.56, 43, 38), new CompanyDataBubble("ATRS", 0.78, 42, 0), new CompanyDataBubble("JDAS", 0.34, 41, 32), new CompanyDataBubble("SAP", 0.48, 40, 11), new CompanyDataBubble("VRTY", 0.49, 39, 80), new CompanyDataBubble("PSFT", 0.38, 38, 42), new CompanyDataBubble("SRNA", 0.35, 36, 39), new CompanyDataBubble("SPSS", 0.58, 36, 18), new CompanyDataBubble("QSFT", 0.32, 35, 68), new CompanyDataBubble("PTEC", 0.51, 34, 10), new CompanyDataBubble("BMC", 0.58, 32, 37), new CompanyDataBubble("CTXS", 0.16, 32, 9), new CompanyDataBubble("PDFS", 0.22, 31, 18), new CompanyDataBubble("MRCL", 0.3, 30, 22), new CompanyDataBubble("CA", 0.24, 30, 33), new CompanyDataBubble("VRTS", 0.36, 29, 12), new CompanyDataBubble("TIBX", 0.31, 28, 6), new CompanyDataBubble("LTBG", 0.47, 23, 18), new CompanyDataBubble("RATL", 0.26, 23, 23), new CompanyDataBubble("SEBL", 0.23, 19, 15), new CompanyDataBubble("LWSN", 0.27, 16, 13) }; ObjectProvider objProvider = new ObjectProvider(companyData); chart1.getDataSourceSettings().setDataSource(objProvider); DataFieldCollection dataFieldCollection = chart1.getDataSourceSettings().getDataFields(); StringDataField dfSymbol = new StringDataField(); dfSymbol.setDataPath("Symbol"); NumericDataField dfStrength = new NumericDataField(); dfStrength.setDataPath("Strength"); NumericDataField dfRank = new NumericDataField(); dfRank.setDataPath("Rank"); NumericDataField dfPE = new NumericDataField(); dfPE.setDataPath("PE"); dataFieldCollection.add(dfSymbol); dataFieldCollection.add(dfStrength); dataFieldCollection.add(dfRank); dataFieldCollection.add(dfPE); chart1.getData().setSeries(2); SeriesBindings series0Bindings = chart1.getSeries().get(0).getBindings(); SeriesBindings series1Bindings = chart1.getSeries().get(1).getBindings(); series0Bindings.setX(dfStrength); series1Bindings.setX(dfStrength); series0Bindings.setY(dfRank); series1Bindings.setY(dfPE); chart1.getDataSourceSettings().readData(); }
public static class CompanyDataBubble { public CompanyDataBubble(String symbol, double strengh, double rank, double pe) { this.setSymbol(symbol); this.setStrength(strengh); this.setRank(rank); this.setPE(pe); } private String privateSymbol; public final String getSymbol() { return privateSymbol; } public final void setSymbol(String value) { privateSymbol = value; } private double privateStrength; public final double getStrength() { return privateStrength; } public final void setStrength(double value) { privateStrength = value; } private double privateRank; public final double getRank() { return privateRank; } public final void setRank(double value) { privateRank = value; } private double privatePE; public final double getPE() { return privatePE; } public final void setPE(double value) { privatePE = value; } }
value
- resetMaximumBubbleSize
public VectorBubbleTemplate getTemplateVectorBubbleTemplate()
Description goes here
public void setTemplate(VectorBubbleTemplate value)
Description goes here
value
- public VectorBubbleValue getTemplate()
Description goes here
public void setTemplate(VectorBubbleValue value)
Description goes here
value
- public java.lang.String getTemplateString()
Description goes here
public void setTemplate(java.lang.String value)
Description goes here
value
- public boolean isUseArea()
public void setUseArea(boolean value)
value
- public void resetMaximumBubbleSize()
setMaximumBubbleSize
public void resetUseArea()
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.