Package net.i2p.rrd4j
Class SimpleSVGImageWorker
java.lang.Object
org.rrd4j.graph.ImageWorker
net.i2p.rrd4j.SimpleSVGImageWorker
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
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
-
Constructor Details
-
SimpleSVGImageWorker
public SimpleSVGImageWorker(int width, int height)
-
-
Method Details
-
resize
protected void resize(int width, int height) - Specified by:
resize
in classImageWorker
-
reset
Description copied from class:ImageWorker
reset the dimensions of theGraphics2D
- Specified by:
reset
in classImageWorker
-
makeImage
- Specified by:
makeImage
in classImageWorker
- Throws:
IOException
-
drawString
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
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
-