Package net.i2p.rrd4j

Class 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 Detail

      • SimpleSVGImageWorker

        public SimpleSVGImageWorker​(int width,
                                    int height)
    • Method Detail

      • resize

        protected void resize​(int width,
                              int height)
        Specified by:
        resize in class ImageWorker
      • 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 class ImageWorker
      • 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 class ImageWorker