Introduction - If you have any usage issues, please Google them yourself
This a sample code for STM32F4 DISCOVERY board. It basically gets data from the accelerometer makes some calculations and sends it UART, I use an FTDI chip for uart to usb communication with my PC. With a simple PC program you could collect that data and make a graph or whatever you wish.
I Used CooCox IDE to make that project. It is ready to use if you have that software. Otherwise you can still use the code with a bit of tweaking if for some reason you have different peripheral libraries for that board.