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?
Comments are currently closed for this discussion. You can start a new one.
|?||Show this help|
|ESC||Blurs the current field|
|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
You are able to change and memorize a graph and you will have it in the graphs & reports section. More on that here.
Infinite Kind Support
2 Posted by dwg on 02 May, 2017 10:38 PM
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
My extension generates its own custom graph. I would like to add it to the side bar among the provided graphs. Is this possible?
Support Staff 4 Posted by Sean Reilly on 03 May, 2017 11:14 AM
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!
Developer, The Infinite Kind
5 Posted by Max Spivak on 03 May, 2017 04:35 PM
Thank you. I will try this.
Henry closed this discussion on 28 May, 2017 01:13 PM.