Where do I start with drawing Gauges and Graphs?

Discussion in 'Mac Programming' started by rachalmers, Aug 31, 2014.

  1. rachalmers macrumors member

    rachalmers

    Joined:
    Oct 21, 2012
    Location:
    UK
    #1
    Does anyone know of some tutorials that show how to draw gauges, dials, graphs and so on. I've just got to rectangles and squares ... but need to get a bit more complex!! Something like this would be good?
    There appears to be lots for iPhone apps, but little for Mac programming. maybe I'm missing something here.... it just dawned on me that the drawing part may work just as well on Mac as iPhone. hmm
    But I still need a tutorial or a guide.
    Thanks
    [​IMG]
     
  2. pmau macrumors 65816

    Joined:
    Nov 9, 2010
  3. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #3
    Core Graphics code is cross platform, excepting the flipped coordinate space. At the moment I don't recall other issues.

    Surprisingly searching for the following didn't come up with much.

    core graphic drawing gauges

    Still, theses look like they could be helpful to you drawing gauges.

    CORE ANIMATION TUTORIAL: SLIDER BASED LAYER ROTATION
    http://www.cimgf.com/2008/10/25/core-animation-tutorial-slider-based-layer-rotation/

    MSSimpleGauge
    http://code4app.net/ios/Simple-Gauge/5204934a6803fa901a000000


    Core Plot is popular for graphing so you may find many good examples.
     
  4. rachalmers, Aug 31, 2014
    Last edited: Aug 31, 2014

    rachalmers thread starter macrumors member

    rachalmers

    Joined:
    Oct 21, 2012
    Location:
    UK
    #4
    Core Plot and the Layer Rotate tutorial

    Core Plot, there is a LOT in it, looks a good place to start, and the Core Animation Tutorial as well might get me started. MSSimple gauge is iOS.

    Thanks for the pointers, I'll see how I go.

    actually, I may just be able to take some good gauge graphics, and then just animate the needle ?

    Just discovered the Animation tutorial won't build on 10.9 (It's from 2008) so I'll have to hack about with that one. But coreplot contains some useful information.
     
  5. klaxamazoo macrumors 6502

    Joined:
    Sep 8, 2006
    #5
    For simple gauges, look into paintcode:
    http://www.paintcodeapp.com/

    For more complicated graphs you could use the DataGraph framework:
    http://www.visualdatatools.com/DataGraph/

    Simply make a graph, save it, and use that as a template where all you do is replace the data using a couple lines of code (4 lines including loading the controller). You have to pay for commercial access to the license, but it is probably faster than learning a plotting framework and it would look better.
     

Share This Page