GraphToImage did the trick. With the old project it returned incorrect values so I thought it was the wrong function to use. Then I made a new test project and it works fine.
The old project must have something misconfigured. I'll look over chart settings, axises etc. Its of course too much to ask where you think the culprit is likely to be, but who knows. :-)