return opportunities;
}
public DataSet generateDataSet(String uuid, int opportunitiesPerMonth, int startYear, int endYear) {
List<Opportunity> opportunities = randomOpportunities(opportunitiesPerMonth, startYear, endYear);
DataSet dataSet = dataSetManager.createDataSet(uuid);
dataSet.addColumn(AMOUNT, ColumnType.NUMBER);
dataSet.addColumn(CREATION_DATE, ColumnType.DATE);
dataSet.addColumn(CLOSING_DATE, ColumnType.DATE);
dataSet.addColumn(PIPELINE, ColumnType.LABEL);
dataSet.addColumn(STATUS, ColumnType.LABEL);
dataSet.addColumn(CUSTOMER, ColumnType.LABEL);
dataSet.addColumn(COUNTRY, ColumnType.LABEL);
dataSet.addColumn(PRODUCT, ColumnType.LABEL);
dataSet.addColumn(SALES_PERSON, ColumnType.LABEL);
dataSet.addColumn(PROBABILITY, ColumnType.LABEL);
dataSet.addColumn(SOURCE, ColumnType.LABEL);
dataSet.addColumn(EXPECTED_AMOUNT, ColumnType.NUMBER);
dataSet.addColumn(COLOR, ColumnType.LABEL);
for (int i = 0; i < opportunities.size(); i++) {
Opportunity opp = opportunities.get(i);
dataSet.setValueAt(i, 0, opp.amount);
dataSet.setValueAt(i, 1, opp.creationDate);
dataSet.setValueAt(i, 2, opp.closingDate);
dataSet.setValueAt(i, 3, opp.pipeline);
dataSet.setValueAt(i, 4, opp.status);
dataSet.setValueAt(i, 5, opp.customer);
dataSet.setValueAt(i, 6, opp.country);
dataSet.setValueAt(i, 7, opp.product);
dataSet.setValueAt(i, 8, opp.salesPerson);
dataSet.setValueAt(i, 9, opp.probability);
dataSet.setValueAt(i, 10, opp.source);
dataSet.setValueAt(i, 11, opp.expectedAmount);
dataSet.setValueAt(i, 12, opp.color);
}
return dataSet;
}