Why these examples do not help you ?
cpuplot is very simple, try to modify it for your needs,
it's just 4 curves updated with a timer.