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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawString(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 doublegetStringWidth(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 voidprotected voidreset(Graphics2D g2d) reset the dimensions of theGraphics2Dprotected voidresize(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:
resizein classImageWorker
-
reset
Description copied from class:ImageWorkerreset the dimensions of theGraphics2D- Specified by:
resetin classImageWorker
-
makeImage
- Specified by:
makeImagein 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:
drawStringin 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:
getStringWidthin classImageWorker
-