SVGString returns an SVG representation of the plot as a string
()
| 22 | |
| 23 | // SVGString returns an SVG representation of the plot as a string |
| 24 | func (pt *Plot) SVGString() string { |
| 25 | b := &bytes.Buffer{} |
| 26 | pt.Paint.SVGOut = b |
| 27 | pt.svgDraw() |
| 28 | pt.Paint.SVGOut = nil |
| 29 | return b.String() |
| 30 | } |
| 31 | |
| 32 | // svgDraw draws SVGOut writer that must already be set in Paint |
| 33 | func (pt *Plot) svgDraw() { |