File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
app/src/main/java/org/gnucash/android/ui/report Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,9 @@ private BarData getData() {
229
229
if (!accountToColorMap .containsKey (account .getUID ())) {
230
230
Integer color ;
231
231
if (mUseAccountColor ) {
232
- color = account .getColor ();
232
+ color = (account .getColor () != Account .DEFAULT_COLOR )
233
+ ? account .getColor ()
234
+ : COLORS [accountToColorMap .size () % COLORS .length ];
233
235
} else {
234
236
color = COLORS [accountToColorMap .size () % COLORS .length ];
235
237
}
Original file line number Diff line number Diff line change 42
42
import org .gnucash .android .R ;
43
43
import org .gnucash .android .app .GnuCashApplication ;
44
44
import org .gnucash .android .db .AccountsDbAdapter ;
45
- import org .gnucash .android .db .TransactionsDbAdapter ;
46
45
import org .gnucash .android .model .Account ;
47
46
import org .gnucash .android .model .AccountType ;
48
47
@@ -197,9 +196,15 @@ private PieData getData() {
197
196
mReportStartTime , mReportEndTime ).asDouble ();
198
197
if (balance > 0 ) {
199
198
dataSet .addEntry (new Entry ((float ) balance , dataSet .getEntryCount ()));
200
- colors .add (mUseAccountColor
201
- ? account .getColor ()
202
- : ReportsActivity .COLORS [(dataSet .getEntryCount () - 1 ) % ReportsActivity .COLORS .length ]);
199
+ int color ;
200
+ if (mUseAccountColor ) {
201
+ color = (account .getColor () != Account .DEFAULT_COLOR )
202
+ ? account .getColor ()
203
+ : ReportsActivity .COLORS [(dataSet .getEntryCount () - 1 ) % ReportsActivity .COLORS .length ];
204
+ } else {
205
+ color = ReportsActivity .COLORS [(dataSet .getEntryCount () - 1 ) % ReportsActivity .COLORS .length ];
206
+ }
207
+ colors .add (color );
203
208
labels .add (account .getName ());
204
209
}
205
210
}
Original file line number Diff line number Diff line change @@ -199,7 +199,9 @@ private PieData getData() {
199
199
Collections .singletonList (account .getUID ()), start , end ).asDouble ();
200
200
if (balance > 0 ) {
201
201
dataSet .addEntry (new Entry ((float ) balance , dataSet .getEntryCount ()));
202
- colors .add (account .getColor ());
202
+ colors .add (account .getColor () != Account .DEFAULT_COLOR
203
+ ? account .getColor ()
204
+ : ReportsActivity .COLORS [(dataSet .getEntryCount () - 1 ) % ReportsActivity .COLORS .length ]);
203
205
labels .add (account .getName ());
204
206
}
205
207
}
You can’t perform that action at this time.
0 commit comments