I don't know about a library API for it, but I find
gnuplot tough to beat for versatility and performance. I've used it embedded into applications by piping data into it, and having it save plot files on disk.
Are you looking to produce presentation style (hardcopy-friendly), web style graphics, other...?
Depending on your exact requirements, it might be easy enough to roll your own package.
--- rod.