Adding new graphs
I'm writing an extension that shows a graph of all credit card monthly balances for some timeframe, say a year going back. Is there a way to add a new graph in the Graphs & Reports section?
Thx,
Max
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Henry on 02 May, 2017 07:09 PM
Hi Max,
You are able to change and memorize a graph and you will have it in the graphs & reports section. More on that here.
Henry
Infinite Kind Support
2 Posted by dwg on 02 May, 2017 10:38 PM
Henry,
I believe that Max would like to add graphs that his extension generates to the side bar, not a modified version of the existing inbuilt graph.
3 Posted by Max Spivak on 03 May, 2017 06:14 AM
Hi Henry,
My extension generates its own custom graph. I would like to add it to the side bar among the provided graphs. Is this possible?
Thx,
Max
Support Staff 4 Posted by Sean Reilly on 03 May, 2017 11:14 AM
Hi Max,
We don't have an official API for this (though we should!) but it may be possible, even if difficult. You can try registering an entry for a "memorised" instance of your graph in the same way that the built-in graph/report code does it. The sidebar items are based on a ReportSpec object (http://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/mode...) which you can create and setup with the class name for your graph as well as the settings/parameters. Your graph generator will need to subclass com.moneydance.apps.md.view.gui.GraphReportGenerator which is probably the trickiest part as that isn't a part of the public API. Once you have your GraphReportGenerator subclass that returns a GraphSet object from the generate() method, you create a ReportSpec to reference it. Then on that ReportSpec object do the following:
when finished, call .syncItem() on your report spec and it should automatically appear in the sidebar.
Hope this works!
Sean Reilly
Developer, The Infinite Kind
http://infinitekind.com
5 Posted by Max Spivak on 03 May, 2017 04:35 PM
Thank you. I will try this.
///Max
Henry closed this discussion on 28 May, 2017 01:13 PM.