Summary: | Broken net worth graph in case data contains only the same value | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Ralf Habacker <ralf.habacker> |
Component: | reports | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | lukasz.wojnilowicz |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | https://commits.kde.org/kmymoney/df06a0d0e44c4b21c9675abff4f7809534b65e05 | Version Fixed In: | 4.8.1 |
Attachments: |
kmymoney test file
Net worth graph on master |
Description
Ralf Habacker
2017-08-05 09:15:11 UTC
Git commit df06a0d0e44c4b21c9675abff4f7809534b65e05 by Ralf Habacker. Committed on 05/08/2017 at 09:16. Pushed by habacker into branch '4.8'. Fix 'Broken net worth graph in case data contains only the same value' If chart model contains only data with the same value KDChart 2.6 automatically adjust the vertical range to a non visible area and displays x axis labels at the top of the diagram. The fix is to disable "auto adjust vertical range to data". The used value has been empirically determined. FIXED-IN:4.8.1 M +1 -0 kmymoney/reports/kreportchartview.cpp https://commits.kde.org/kmymoney/df06a0d0e44c4b21c9675abff4f7809534b65e05 Ralf, it would be better if you would test master version before 'producing' bug. *** This bug has been marked as a duplicate of bug 338642 *** (In reply to NSLW from comment #2) > Ralf, it would be better if you would test master version before 'producing' > bug. > *** This bug has been marked as a duplicate of bug 338642 *** I don't think that this is the same bug as 338642. git master now contains a short KChart widget test. You may modify kmymoney/reports/tests/chart-test.cpp as shown below: QVector< double > vec0, vec1, vec2; - vec0 << 5 << 1 << 3 << 4 << 1; - vec1 << 3 << 6 << 2 << 4 << 8; - vec2 << 0 << 7 << 1 << 2 << 1;´ +// vec0 << 5 << 1 << 3 << 4 << 1; +// vec1 << 3 << 6 << 2 << 4 << 8; + vec3 << 7 << 7 << 7 << 7 << 7; and let the app run which shows the mentioned behavior. Then modify CartesianAxis *yAxis = new CartesianAxis (widget.lineDiagram() ); + static_cast<CartesianCoordinatePlane*>(widget.lineDiagram()->coordinatePlane())->setAutoAdjustVerticalRangeToData(101); and run again - bug is fixed then modify again - static_cast<CartesianCoordinatePlane*>(widget.lineDiagram()->coordinatePlane())->setAutoAdjustVerticalRangeToData(101); + static_cast<CartesianCoordinatePlane*>(widget.lineDiagram()->coordinatePlane())->setAutoAdjustVerticalRangeToData(2); and compile and run again - bug is not fixed. If you can confirm please restore bug state. (In reply to Ralf Habacker from comment #3) > > QVector< double > vec0, vec1, vec2; > - vec0 << 5 << 1 << 3 << 4 << 1; > - vec1 << 3 << 6 << 2 << 4 << 8; > - vec2 << 0 << 7 << 1 << 2 << 1;´ > +// vec0 << 5 << 1 << 3 << 4 << 1; > +// vec1 << 3 << 6 << 2 << 4 << 8; > + vec3 << 7 << 7 << 7 << 7 << 7; This should be vec2 instead, sorry. Created attachment 107099 [details] Net worth graph on master (In reply to Ralf Habacker from comment #3) > I don't think that this is the same bug as 338642. I tested your file on master (see attached image) and it doesn't pose problem for me. All test passed as well. With your patch you caused to lose one of nice feature I introduced there and additionally introduced a big segmentation fault, crash or something like that. Not all of graphs are on CartesianCoordinatePlane and you make static_cast for all of them there. Your behaviour is irritating. You don't test your code (this is great example), you don't consult your code (see bug #383165) and the code you're pushing is misleading (see commit cb841612e11349aca26b6c4af4ff7dced9a95357). Your work is very much obfuscated, so come to order or stop doing that. Git commit 6e5b5fd698aac46906e37b2ba3ac0c1e2fc5edfb by Ralf Habacker. Committed on 07/08/2017 at 08:58. Pushed by habacker into branch '4.8'. Do not use static cast to avoid crashes in case the plane does not have the expected type Thanks to Lukasz Wojnilowicz for pointing out. M +4 -2 kmymoney/reports/kreportchartview.cpp https://commits.kde.org/kmymoney/6e5b5fd698aac46906e37b2ba3ac0c1e2fc5edfb |