cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bubble Chart - Java

Contributor

Bubble Chart - Java

Hi there, 

 

I'm new to java so please forgive me.

 

I'm trying to code an Application Bubble Chart Report Chapter in java. The point would be to display 2 customised attributes (APM_Business Value and APM_Technology Stability) together with the Cost.

 

To do so, I'm trying to loop the parameters value, and then, for each of them, add an item on the Bubble Chart. 

The syntax is obviously wrong, see below in bold. I have no clue how to add an item per Application with the 4 attributes (Short Name, Business Value, Technology Stability, Cost). What should it be?

 

Thanks for your help guys.

 

 

public class Bubble_Report implements AnalysisReport {
	@SuppressWarnings("deprecation")
	@Override
public ReportContent getReportContent(final MegaRoot root, final Map<String, List<AnalysisParameter>> parameters, final Object userData) {
// Error Management exemple
final ErrorLogFormater err = new ErrorLogFormater();
err.openSession(root);
// Do not forget to update this line
err.addSessionInfo("Component", "(Java) New Analysis Engine:TestReport: getReportContent");
// Initialize the report content
final ReportContent reportContent = new ReportContent("");
try {
	final Dataset paramDataset = new Dataset("");
	final Dimension dim1 = new Dimension("~1GY6tlX0EPr2[APM_Business Value]");
	final Dimension dim2 = new Dimension("~kGY66mX0EDt2[APM_Technology Stability]");
	final Dimension dim3 = new Dimension("~7s12PbZQ9Pn1[Cost]");
	dim1.setSize(5);
	dim2.setSize(4);
	dim3.setSize(3);
	paramDataset.addDimension(dim1);
	paramDataset.addDimension(dim2);
	paramDataset.addDimension(dim3);

	int i = 1;
	// Going through its values
	for (final String paramType : parameters.keySet()) {
		for (final AnalysisParameter paramValue : parameters.get(paramType)) {
			for (final MegaObject value : paramValue.getValues()) {
			paramDataset.addItem(new MegaObjectProperty(value.megaField(), "~Z20000000D60[Short Name]"), MegaObject.GetProp("~1GY6tlX0EPr2[APM_Business Value]") + "," + MegaObject.GetProp("~kGY66mX0EDt2[APM_Technology Stability]") + "," + MegaObject.GetProp("~7s12PbZQ9Pn1[Cost]"));
			i++;
			}
		}
	}
	// Add the Dataset to the report
	final int datasetID = reportContent.addDataset(paramDataset);
	// Add the Dataset to many different views
	final View v21 = new View(datasetID);
	v21.addRenderer(AnalysisReportToolbox.rBubbleChart);
	reportContent.addView(v21);
}
finally {
	}
	return reportContent;}
}

 

Tags (4)