From what I know SVG is not exactly a canvas where you can draw on. It display some vector drawings defined as XML.
A long time ago, I had written some code that produce some XML (into a String) and pass it to the SVG Field.
String xmlString = BarGraphGenerator.generate(values); //Something to generate the xml
InputStream in = BarGraphGenerator.convertToInputStream(xmlString);
I assume this code still work (I do not have checked).