There's lot's of software you can download which already does this, but if you've got to write your own, which part are you having problems with?, reading the analogue input, or displaying the graph.
You don't mention what language you will be using, but a quick google found this site http://www.swiftsoft.de/mmtools.html with components (chargeable ones though) for Delphi and C++. The demos look pretty impressive!.