graph widget

Does anyone have a code snipet that will help me get started creating a simple graph.  I want to graph the sensors which are on the phone.  accellerometer, gps etc…  This type of thing: 

[sharedmedia=core:attachments:8441]

Thanks L