Bug 408361

Summary: Hardly distinguishable line colors in reports
Product: [Applications] kmymoney Reporter: Ralf Habacker <ralf.habacker>
Component: reportsAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 4.8.3   
Target Milestone: ---   
Platform: Other   
OS: Unspecified   
Latest Commit: Version Fixed In: 4.8.4, 5.0.6
Sentry Crash Report:
Attachments: Screenshot showing a diagram with multiple lines

Description Ralf Habacker 2019-06-05 22:07:45 UTC
Created attachment 120610 [details]
Screenshot showing a diagram with multiple lines

SUMMARY
Diagrams with several accounts are often difficult to distinguish, since the colors used are very similar. 


STEPS TO REPRODUCE
1. Create a report with multiple accounts
2. show as diagram

OBSERVED RESULT
In the attached example, the lines for the account "different costs" and the line for "room costs" can hardly be distinguished, also for "car costs", "cost of living", "interest expenses" and "advertising/travel expenses".


EXPECTED RESULT
The colors should be more different

SOFTWARE/OS VERSIONS
Windows: 7
KDE Frameworks Version: 5.47
Qt Version: 5.9.1

ADDITIONAL INFORMATION
The used chart library supports different color palettes (see https://docs.kdab.com/kdchart/latest/class_k_d_chart_1_1_palette.html#details), so it should be possible 
1. to choose another one or 
2. add support to let the user choose a color palette from a predefined set or 
3. add support to let the user create a custom palette
Comment 1 Ralf Habacker 2019-06-05 23:24:32 UTC
(In reply to Ralf Habacker from comment #0)
> 2. add support to let the user choose a color palette from a predefined set
After looking into the code I found that exactly this case is already be implemented. :-)

Unfortunally in kmymoney/settings/kmymoney.kcfg there is:

  <entry name="ChartsPalette" type="Int">
   <label>The palette used to render charts</label>
   <default>2</default>
   <min>0</min>
   <max>2</max>
  </entry>

which indicates that the default setting is set to 2 (='subdued') and produces exactly the colors from the screenshot. Using either 'default' or 'rainbow' gives much better results.

At least for new users the default value should be set to 'default' from my opinion.
Comment 2 Ralf Habacker 2019-06-06 21:05:48 UTC
(In reply to Ralf Habacker from comment #1)
>  Using either 'default' or 'rainbow' gives much better results.
This depends on the type of diagram diagram: a diagram with bars is also looking good with palette type 'subdued'. May be this option would be good to be report specific.
Comment 3 Ralf Habacker 2019-07-05 18:43:36 UTC
Patch for 5.0 branch opened at https://phabricator.kde.org/D22293
Comment 4 Ralf Habacker 2019-07-05 19:34:50 UTC
Git commit 5d31234bb46593697d8ca1048ed33cfff4e2ca32 by Ralf Habacker.
Committed on 05/07/2019 at 19:09.
Pushed by habacker into branch '4.8'.

Fix 'Hardly distinguishable line colors in reports'

The color palette used for a diagram can now be modified in
individual reports.
FIXED-IN:4.8.4

M  +6    -0    kmymoney/dialogs/kreportconfigurationfilterdlg.cpp
M  +10   -0    kmymoney/mymoney/mymoneyreport.cpp
M  +16   -0    kmymoney/mymoney/mymoneyreport.h
M  +19   -5    kmymoney/reports/kreportchartview.cpp
M  +28   -1    kmymoney/widgets/kmymoneyreportconfigtabchartdecl.ui
M  +5    -0    kmymoney/widgets/kmymoneyreportconfigtabimpl.cpp

https://commits.kde.org/kmymoney/5d31234bb46593697d8ca1048ed33cfff4e2ca32
Comment 5 Ralf Habacker 2019-08-06 09:23:59 UTC
Git commit 1e4db1595f7f1751f7f4c4139047e581f20d7647 by Ralf Habacker.
Committed on 06/08/2019 at 09:23.
Pushed by habacker into branch '5.0'.

Fix 'Hardly distinguishable line colors in reports'

The color palette used for a diagram can now be modified in
individual reports.

Note: In KReportConfigurationFilterDlg::slotSearch there is redundant code
for casting eMyMoney::Report::ChartPalette to int which is already implemented
in xmlstoragehelper.cpp.
FIXED-IN:4.8.4,5.0.6
Differential Revision: https://phabricator.kde.org/D22293

M  +2    -0    kmymoney/mymoney/mymoneyenums.h
M  +12   -0    kmymoney/mymoney/mymoneyreport.cpp
M  +4    -0    kmymoney/mymoney/mymoneyreport.h
M  +5    -0    kmymoney/mymoney/mymoneyreport_p.h
M  +19   -5    kmymoney/plugins/views/reports/core/kreportchartview.cpp
M  +1    -0    kmymoney/plugins/views/reports/kbalancechartdlg.cpp
M  +13   -1    kmymoney/plugins/views/reports/kreportconfigurationfilterdlg.cpp
M  +42   -0    kmymoney/plugins/views/reports/reporttabchart.ui
M  +5    -0    kmymoney/plugins/views/reports/reporttabimpl.cpp
M  +51   -1    kmymoney/plugins/xmlhelper/xmlstoragehelper.cpp

https://commits.kde.org/kmymoney/1e4db1595f7f1751f7f4c4139047e581f20d7647