Extension Logging + Graphing

Yuriy 's Avatar

Yuriy

19 Jun, 2019 05:12 AM

Hey Folks,
I'm playing around with the extension java api, and have some questions that I couldn't find answers to in Java Docs.

1) What graphing library can we use to create charts? I want to keep the look of the extension consistent.
2) How to log to the moneydance console?
3) What is a good way to store extension settings?

Yury

  1. 1 Posted by Mike Bray on 19 Jun, 2019 08:32 AM

    Mike Bray 's Avatar

    Hi Yuri

    I can not answer the item about graphing.

    The MD console is a redirected syserr so if you use:
    System.err.println(strExtension + ">"+type+":"+Thread.currentThread().getName()+"("+strClass+","+strMethod+ ") " +strMessage);

    the line will appear on the console

    For the parameters I use a file that sits in the directory of the current data file and uses json to serialise/unserialise a parameters class.

    You can find examples of this at https://bitbucket.org/mikerb/moneydance-2019/src/master/src/com/mon...
    Mike

  2. 2 Posted by Yuriy on 21 Jun, 2019 02:21 AM

    Yuriy 's Avatar

    Thanks. That worked.

  3. Support Staff 3 Posted by Sean Reilly on 21 Jun, 2019 09:21 AM

    Sean Reilly's Avatar

    Hi Yury,
    For graphing, Moneydance bundles the jfreechart library from here: http://www.jfree.org/jfreechart/

    As for storing extension settings, if you have settings associated with a specific data file, I'd use the LocalStorage object that you can get from the AccountBook: https://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/mod...

    If you have data that you'd like to be associated with specific objects within Moneydance you can use the setPreference*/getPreference* methods of MoneydanceSyncableItem which is a subclass of any data object in Moneydance. The setPreference/getPreference methods will store data in the local storage, which isn't synced across devices, but is stored securely and automatically associated with that data object on the same computer. If you use getParameter/setParameter methods then those are synced across devices. Using any of these methods, you should take care to prefix any parameter names (keys) with a unique string to avoid conflicting with other parameters.

    Thanks,
    Sean

    --
    Sean Reilly
    Developer, The Infinite Kind
    https://infinitekind.com

  4. System closed this discussion on 20 Sep, 2019 09:30 AM.

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