Package net.i2p.rrd4j
Class SimpleSVGImageWorker
- java.lang.Object
-
- org.rrd4j.graph.ImageWorker
-
- net.i2p.rrd4j.SimpleSVGImageWorker
-
public class SimpleSVGImageWorker extends ImageWorker
rrd4j adapter for SimpleSVGGraphics2D Requires: rrd4j 3.10 or higher Ref: https://github.com/rrd4j/rrd4j/issues/165 Usage: No ImageIO/BufferedImage/ImageWriter required!RRDGraph graph = new RrdGraph(graphdef, new SimpleSVGImageWorker(width, height)); outputstream.write(graph.getRrdGraphInfo().getBytes());
License: Apache 2.0 (same as rrd4j)- Since:
- 0.9.64
- Author:
- zzz
-
-
Constructor Summary
Constructors Constructor Description SimpleSVGImageWorker(int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
drawString(String text, int x, int y, Font font, Paint paint)
Overridden because the SVG format essentially strips leading/trailing spaces, causing alignment issues in ValueAxis with the %x.y number formatting.protected double
getStringWidth(String text, Font font)
Overridden because the SVG format essentially strips leading/trailing spaces, causing alignment issues in ValueAxis with the %x.y number formatting.protected void
makeImage(OutputStream os)
protected void
reset(Graphics2D g2d)
reset the dimensions of theGraphics2D
protected void
resize(int width, int height)
-
Methods inherited from class org.rrd4j.graph.ImageWorker
clip, dispose, drawLine, drawPolyline, fillPolygon, fillPolygon, fillRect, getFontAscent, getFontHeight, getImageBytes, loadImage, makeImage, reset, saveImage, setAntiAliasing, setG2d, setTextAntiAliasing, transform
-
-
-
-
Method Detail
-
resize
protected void resize(int width, int height)
- Specified by:
resize
in classImageWorker
-
reset
protected void reset(Graphics2D g2d)
Description copied from class:ImageWorker
reset the dimensions of theGraphics2D
- Specified by:
reset
in classImageWorker
-
makeImage
protected void makeImage(OutputStream os) throws IOException
- Specified by:
makeImage
in classImageWorker
- Throws:
IOException
-
drawString
protected void drawString(String text, int x, int y, Font font, Paint paint)
Overridden because the SVG format essentially strips leading/trailing spaces, causing alignment issues in ValueAxis with the %x.y number formatting. Consecutive spaces within text are also probably collapsed, that is not addressed here.- Overrides:
drawString
in classImageWorker
-
getStringWidth
protected double getStringWidth(String text, Font font)
Overridden because the SVG format essentially strips leading/trailing spaces, causing alignment issues in ValueAxis with the %x.y number formatting. Consecutive spaces within text are also probably collapsed, that is not addressed here.- Overrides:
getStringWidth
in classImageWorker
-
-