tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/1842-adding-new-graphsInfinite Kind: Discussion 2018-03-15T05:23:03Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/424640302017-05-01T06:12:23Z2017-05-01T06:12:23ZAdding new graphs<div><p>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?</p>
<p>Thx,<br>
Max</p></div>Max Spivaktag:infinitekind.tenderapp.com,2009-01-14:Comment/424640302017-05-02T19:09:59Z2017-05-02T19:09:59ZAdding new graphs<div><p>Hi Max,</p>
<p>You are able to change and memorize a graph and you will have it in the graphs & reports section. More on that <a href="http://help.infinitekind.com/kb/moneydance-2017/moneydance-2017-graphs-and-reports#memorized-graphs-and-reports-">here</a>.</p>
<p>Henry<br>
Infinite Kind Support</p></div>Henrytag:infinitekind.tenderapp.com,2009-01-14:Comment/424640302017-05-02T22:38:29Z2017-05-02T22:38:29ZAdding new graphs<div><p>Henry,</p>
<p>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.</p></div>dwgtag:infinitekind.tenderapp.com,2009-01-14:Comment/424640302017-05-03T06:14:09Z2017-05-03T06:14:13ZAdding new graphs<div><p>Hi Henry,</p>
<p>My extension generates its own custom graph. I would like to add it to the side bar among the provided graphs. Is this possible?</p>
<p>Thx,<br>
Max</p></div>Max Spivaktag:infinitekind.tenderapp.com,2009-01-14:Comment/424640302017-05-03T11:14:37Z2017-05-03T11:14:37ZAdding new graphs<div><p>Hi Max,</p>
<p>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 (<a href="http://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/model/ReportSpec.html">http://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/mode...</a>) 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:</p>
<ul>
<li>call setParameter("rpt_gen", yourClassName) where yourClassName is the full package and name of your GraphReportGenerator subclass.</li>
<li>call setMemorized(true)</li>
<li>call setName("whatever you like")</li>
<li>call setReportParameters(SyncRecord parameters) with the parameters that should be passed to your GraphGreportGenerator (things like date ranges, etc) when it is invoked</li>
</ul>
<p>when finished, call .syncItem() on your report spec and it should automatically appear in the sidebar.</p>
<p>Hope this works!</p>
<p>Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="http://infinitekind.com">http://infinitekind.com</a></p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/424640302017-05-03T16:35:42Z2017-05-03T16:35:42ZAdding new graphs<div><p>Thank you. I will try this.</p>
<p>///Max</p></div>Max Spivak