Disclaimer: A lot of this has been discovered through trial and error, I may have some serious false assumptions in play here:
You would need to use the AudioUnits framework. When initialising the playback you can create an AURenderCallbackStruct. You can specify in this struct a playback callback function which provides you with a few arguments which will contain the information you need.
the callback function will have a signature like this:
static OSStatus recordingCallback (void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData)
In here there is an array of audio data which can be used for getting amplitude of the audio buffer for each frequency bin, or for calculating the DB value of the frequency bin.
I don't know what that graph is showing, but it looks to me like a smoothed display of the amplitudes of each of the sample bins.
Audio Units are not simple, but its worth playing with for a while until you get a grip.
Here is a skeleton of my callback function so you have more of a grasp as to what I mean:
EDIT: removed dead link, I've lost this code sorry