Package hudson.util

Class Graph


  • public abstract class Graph
    extends Object
    A JFreeChart-generated graph that's bound to UI.

    This object exposes two URLs:

    /png
    PNG image of a graph
    /map
    Clickable map
    Since:
    1.320
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • Graph

        protected Graph​(long timestamp,
                        int defaultWidth,
                        int defaultHeight)
        Parameters:
        timestamp - Timestamp of this graph. Used for HTTP cache related headers. If the graph doesn't have any timestamp to tie it to, pass -1.
      • Graph

        protected Graph​(Calendar timestamp,
                        int defaultWidth,
                        int defaultHeight)
    • Method Detail

      • createGraph

        protected abstract org.jfree.chart.JFreeChart createGraph()
        Actually render a chart.
      • safeDimension

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public static Dimension safeDimension​(int width,
                                              int height,
                                              int defaultWidth,
                                              int defaultHeight)
      • doPng

        public void doPng​(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws IOException
        Renders a graph.
        Throws:
        IOException
      • doMap

        public void doMap​(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws IOException
        Renders a clickable map.
        Throws:
        IOException