*/
public static DefaultCategoryDataset getIncomeExpensesOverTime(
List<Annotation> annotations, int year, Book selectedBook,
BookSelectionType bookSelectionType) {
ProperitesChartDataModel properitesChartDataModel = getIncomeExpensesOverTimeChartDataModel(
annotations, year);
List<String> listOfLabels = getListOfMonthTimeLabelsForYear(year);
DefaultCategoryDataset model = new DefaultCategoryDataset();
if (bookSelectionType.getIsAllBooks()
|| (selectedBook instanceof PropertyBook)) {
Map<String, Double> valuesMapIncome = properitesChartDataModel
.getChartData().get(INCOME_PROPERTIES);
for (String currentLabel : listOfLabels) {
Double currentValue = valuesMapIncome.get(currentLabel);
model.addValue(currentValue, INCOME_PROPERTIES, currentLabel);
}
}
if (bookSelectionType.getIsAllBooks()
|| !(selectedBook instanceof PropertyBook)) {
Map<String, Double> valuesMapIncomeOwn = properitesChartDataModel
.getChartData().get(INCOME_OWN);
for (String currentLabel : listOfLabels) {
Double currentValue = valuesMapIncomeOwn.get(currentLabel);
model.addValue(currentValue, INCOME_OWN, currentLabel);
}
}
if (bookSelectionType.getIsAllBooks()
|| !(selectedBook instanceof PropertyBook)) {
Map<String, Double> valuesMapIncomeStocks = properitesChartDataModel
.getChartData().get(INCOME_STOCKS);
for (String currentLabel : listOfLabels) {
Double currentValue = valuesMapIncomeStocks.get(currentLabel);
model.addValue(currentValue, INCOME_STOCKS, currentLabel);
}
}
if (bookSelectionType.getIsAllBooks()
|| (selectedBook instanceof PropertyBook)) {
Map<String, Double> valuesMapExpenses = properitesChartDataModel
.getChartData().get(EXPENSES_PROPERITES);
for (String currentLabel : listOfLabels) {
Double currentValue = valuesMapExpenses.get(currentLabel);
model.addValue(currentValue, EXPENSES_PROPERITES, currentLabel);
}
}
if (bookSelectionType.getIsAllBooks()
|| !(selectedBook instanceof PropertyBook)) {
Map<String, Double> valuesMapExpensesOwn = properitesChartDataModel
.getChartData().get(EXPENSES_OWN);
for (String currentLabel : listOfLabels) {
Double currentValue = valuesMapExpensesOwn.get(currentLabel);
model.addValue(currentValue, EXPENSES_OWN, currentLabel);
}
}
if (bookSelectionType.getIsAllBooks()
|| !(selectedBook instanceof PropertyBook)) {
Map<String, Double> valuesMapExpensesStocks = properitesChartDataModel
.getChartData().get(EXPENSES_STOCKS);
for (String currentLabel : listOfLabels) {
Double currentValue = valuesMapExpensesStocks.get(currentLabel);
model.addValue(currentValue, EXPENSES_STOCKS, currentLabel);
}
}
if (!bookSelectionType.getIsAllBooks()) {
Map<String, Double> valuesMap = properitesChartDataModel
.getChartData().get(TOTAL);
for (String currentLabel : listOfLabels) {
Double currentValue = valuesMap.get(currentLabel);
model.addValue(currentValue, TOTAL, currentLabel);
}