Skip to content

Commit

Permalink
Added absolute delta to available line series
Browse files Browse the repository at this point in the history
  • Loading branch information
buchen committed May 29, 2014
1 parent 99ed5dd commit 9880c0f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public class Messages extends NLS
public static String JurisdictionFilesDownloadExplanation;
public static String JurisdictionFilesDownloadMessage;
public static String JurisdictionFilesDownloadTitle;
public static String LabelAbsoluteDelta;
public static String LabelAccounts;
public static String LabelAccumulatedTaxes;
public static String LabelAggregationDaily;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ JurisdictionFilesDownloadMessage = Your current Java installation does not suppo

JurisdictionFilesDownloadTitle = AES 256 not supported

LabelAbsoluteDelta = Delta (Total Sum - Invested Capital)

LabelAccounts = Accounts

LabelAccumulatedTaxes = Taxes (accumulated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ JurisdictionFilesDownloadMessage = Die aktuelle Java Installation unterst\u00FCt

JurisdictionFilesDownloadTitle = AES 256 nicht unterst\u00FCtzt

LabelAbsoluteDelta = Delta (Gesamtsumme - investiertes Kapital)

LabelAccounts = Konten

LabelAccumulatedTaxes = Steuern (akkumuliiert)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
/* package */static enum ClientDataSeries
{
TOTALS, INVESTED_CAPITAL, TRANSFERALS, TAXES;
TOTALS, INVESTED_CAPITAL, TRANSFERALS, TAXES, ABSOLUTE_DELTA;
}

/* package */static final class DataSeries
Expand Down Expand Up @@ -359,6 +359,10 @@ private void buildAvailableDataSeries()
series.setShowArea(true);
availableSeries.add(series);

series = new DataSeries(Client.class, ClientDataSeries.ABSOLUTE_DELTA, Messages.LabelAbsoluteDelta,
Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
availableSeries.add(series);

series = new DataSeries(Client.class, ClientDataSeries.TAXES, Messages.LabelAccumulatedTaxes, Display
.getDefault().getSystemColor(SWT.COLOR_RED));
availableSeries.add(series);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ private void addClient(DataSeries item, List<Exception> warnings)
item.getLabel());
item.configure(ivSeries);
break;
case ABSOLUTE_DELTA:
ILineSeries dSeries = chart.addDateSeries(clientIndex.getDates(), //
toDouble(clientIndex.calculateAbsoluteDelta(), Values.Amount.divider()), //
item.getLabel());
item.configure(dSeries);
break;
case TAXES:
ILineSeries txSeries = chart.addDateSeries(clientIndex.getDates(), //
accumulateAndToDouble(clientIndex.getTaxes(), Values.Amount.divider()), //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ public long[] calculateInvestedCapital()
return investedCapital;
}

public long[] calculateAbsoluteDelta()
{
long[] answer = calculateInvestedCapital();

for (int ii = 0; ii < answer.length; ii++)
answer[ii] = totals[ii] - answer[ii];

return answer;
}

public DateTime getFirstDataPoint()
{
for (int ii = 0; ii < totals.length; ii++)
Expand Down

0 comments on commit 9880c0f

Please sign in to comment.