Remember charts size
Reported by Virgil Dupras | July 18th, 2012 @ 02:36 PM
From e-mail:
However, moneyGuru still resets the pie charts and column sizes. This wasn’t the case with earlier versions. The bug appeared around the same time as the other one. Basically, I prefer to see the pie charts stacked up with the income on top of the expenses.
The size for charts were never remembered, but still, it should be.
Comments and changes to this ticket
-
Virgil Dupras September 18th, 2012 @ 05:52 PM
- Assigned user set to Virgil Dupras
-
Virgil Dupras September 18th, 2012 @ 06:29 PM
Mmmm... I could do this quick and easy by duplicating the save/restore code in each GUI layer, but that would increase moneyGuru's technical debt. Moreover, the save/restore data wouldn't be document-dependent unless I hack something (which would even further increase the TD).
I think that the core should ideally handle this save/restore by making all charts send down their size (something that is already done with
Chart.set_view_size()
, which is used for dynamic pie chart pies count). Then, the core could save these values on document close. Then it would be a matter of adding a new Chart's view call to tell the GUI view to restore the view size (that would be called on document open).However, there's an extra difficulty: The Double View mechanism used for pie charts (so that we have 2 pie charts in the net worth and P&L views). These are entirely implemented in the 2 GUI layers and are unknown to the core. For the sizes to be able to be restored properly, I would first have to push the Double View logic down to the core.
This would mean that I would end up with a single view/widget in the core that manages its drawing coordinates so that it knows that the asset pie chart is drawn at the top and the liability pie chart is drawn at the bottom.
But that can't really work unless I give more "drawing power" to the core. Right now, the GUI layer has the complete initiative over how the drawing is done. All the chart does is to supply ready-to-draw data. In PdfMasher, I've done a good job of inverting the drawing control down to the core. I should do the same in moneyGuru.
Whew! That's a lot of work just for that small feature! Again, I'm all against over-engineering and all, but the quick & dirty way is too hacky, especially when the time will come to make these save/restore document-dependent.
-
Virgil Dupras September 18th, 2012 @ 09:43 PM
(from [1d2c70029fc6]) [#339] First foray into pushing chart drawing to the core.
The title of the pie charts is now drawn in the core.
https://bitbucket.org/hsoft/moneyguru/changeset/1d2c70029fc6/ -
Virgil Dupras September 18th, 2012 @ 11:04 PM
(from [29301446e19f]) [#339] Pushed pie drawing in the pie charts to the core. https://bitbucket.org/hsoft/moneyguru/changeset/29301446e19f/
-
Virgil Dupras September 19th, 2012 @ 06:28 PM
(from [c404ed3e9300]) [#339] Pushed the rest of pie chart drawing down to the core. https://bitbucket.org/hsoft/moneyguru/changeset/c404ed3e9300/
-
Virgil Dupras September 20th, 2012 @ 06:21 PM
(from [503c815e0d6d]) [#339] Added font and gradient cache in GUI layers' chart controller. https://bitbucket.org/hsoft/moneyguru/changeset/503c815e0d6d/
-
Virgil Dupras September 21st, 2012 @ 04:11 AM
(from [408a9fa08a1c]) [#339] Instead of a simple ColorIndex, introduced the concept of PenID and BrushID in chart drawing.
This gives more flexibility to presentation, a flexibility which will be needed for the next chart to be pushed down to the core, the bar graph.
https://bitbucket.org/hsoft/moneyguru/changeset/408a9fa08a1c/ -
Virgil Dupras September 21st, 2012 @ 05:44 PM
(from [641ba006e3eb]) [#339] Pushed bar chart drawing to the core. https://bitbucket.org/hsoft/moneyguru/changeset/641ba006e3eb/
-
Virgil Dupras September 21st, 2012 @ 08:15 PM
(from [179592ea2970]) [#339] Pushed balance graph and axis overlay drawing down to the core. https://bitbucket.org/hsoft/moneyguru/changeset/179592ea2970/
-
Virgil Dupras September 22nd, 2012 @ 04:33 PM
(from [3299b66d0d3b]) [#339] Pushed graph axis, tickmarks, labels and title drawing down to the core.
That was a bit messy because previously, all graph drawing were made inside a transform (and under Qt, a Y-scale inversion). I removed that and made all point translation explicit in drawing code. That's a bit ugly, but I hope to make it look a bit better soon.
https://bitbucket.org/hsoft/moneyguru/changeset/3299b66d0d3b/ -
Virgil Dupras September 22nd, 2012 @ 04:48 PM
(from [aa94b3e0c0f5]) [#339] Cleaned up cocoa's chart interfaces now that all data-fetching-from-model methods aren't used anymore.
That removed quite a bit of cruft. MGGraph having become entirely irrelevant, could be removed.
https://bitbucket.org/hsoft/moneyguru/changeset/aa94b3e0c0f5/ -
Virgil Dupras September 22nd, 2012 @ 07:55 PM
(from [90a7e00bf5f1]) [#339] Minor chart drawing adjustments and code cleanup. https://bitbucket.org/hsoft/moneyguru/changeset/90a7e00bf5f1/
-
Virgil Dupras September 23rd, 2012 @ 08:55 PM
(from [39dc0ce6e74d]) [#339] Merged the two pie charts in networth and profit view.
This one pie chart per view now manages the double-pie drawing logic. This lead to a lot of simplification on the Cocoa side, but it also required a lot of changes in the chart printing logic because the old logic of painting the view directly in the print view wouldn't work (it relied on NSView copying, which can't work since the drawing is now made in the core and that copying a view in Cocoa doesn't result in copying a chart in the core).
https://bitbucket.org/hsoft/moneyguru/changeset/39dc0ce6e74d/ -
Virgil Dupras September 24th, 2012 @ 12:57 AM
(from [60ea2bb48e5b]) [#339] Fixed pie chart crashes when it tried to draw itself when it had no data to display. https://bitbucket.org/hsoft/moneyguru/changeset/60ea2bb48e5b/
-
Virgil Dupras September 24th, 2012 @ 06:04 PM
(from [7263344da746]) [#339] Fixed a visual glitch in Qt's pie slice drawing. https://bitbucket.org/hsoft/moneyguru/changeset/7263344da746/
-
Virgil Dupras September 25th, 2012 @ 05:46 PM
- State changed from accepted to fixed
(from [b75f96ded49b]) [#339 state:fixed] Save and restore chart sizes.
Whew, that was a lot more work than I would have thought first...
https://bitbucket.org/hsoft/moneyguru/changeset/b75f96ded49b/
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Tags
Referenced by
- 345 Document based main window's frame restoration Right now, the main window is only restored on Cocoa, and...