Package hudson.model

Class MultiStageTimeSeries.TrendChart

java.lang.Object
hudson.model.MultiStageTimeSeries.TrendChart
All Implemented Interfaces:
org.kohsuke.stapler.HttpResponse
Enclosing class:
MultiStageTimeSeries

public static class MultiStageTimeSeries.TrendChart extends Object implements org.kohsuke.stapler.HttpResponse
Represents the trend chart that consists of several MultiStageTimeSeries.

This object is renderable as HTTP response.

  • Field Details

  • Constructor Details

  • Method Details

    • createDataset

      protected org.jfree.data.category.DefaultCategoryDataset createDataset()
      Creates a DefaultCategoryDataset for rendering a graph from a set of MultiStageTimeSeries.
    • createChart

      public org.jfree.chart.JFreeChart createChart()
      Draws a chart into JFreeChart.
    • configureRangeAxis

      protected void configureRangeAxis(org.jfree.chart.axis.NumberAxis rangeAxis)
    • crop

      protected void crop(org.jfree.chart.plot.CategoryPlot plot)
    • configureDomainAxis

      protected org.jfree.chart.axis.CategoryAxis configureDomainAxis(org.jfree.chart.plot.CategoryPlot plot)
    • configureRenderer

      protected void configureRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer renderer)
    • configurePlot

      protected void configurePlot(org.jfree.chart.plot.CategoryPlot plot)
    • createSvg

      public String createSvg()
      Renders this trend chart as an inline SVG document.

      Unlike generateResponse(org.kohsuke.stapler.StaplerRequest2, org.kohsuke.stapler.StaplerResponse2, java.lang.Object), which produces a theme-agnostic PNG via JFreeChart, this builds an SVG string meant to be embedded directly into the page DOM. Line and text colors reference CSS custom properties (e.g. var(--red)), so the chart adapts to the active theme (such as dark mode) automatically, and the viewBox lets it scale fluidly with its container instead of being a fixed-size raster.

    • createLegendHtml

      public String createLegendHtml()
      Renders the chart legend as an HTML fragment (a swatch and label per series).

      The legend lives in HTML rather than inside the SVG so the browser measures each label natively and reflows items with flex-wrap; this avoids the per-glyph width guesses that overlapped for wide (e.g. CJK) or enlarged labels. It also makes the labels readable to assistive technology, which treats the role="img" SVG as an opaque image and never exposes text drawn inside it.

    • createSvgWithLegend

      public String createSvgWithLegend()
      Convenience wrapper returning the legend followed by the chart SVG as a single HTML fragment for embedding into the page DOM. The legend comes first so it renders above the chart; the lone <svg> element is preserved so callers can still locate it (e.g. to set an accessible name).
    • generateResponse

      public void generateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node) throws IOException, jakarta.servlet.ServletException
      Renders this object as an image.
      Specified by:
      generateResponse in interface org.kohsuke.stapler.HttpResponse
      Throws:
      IOException
      jakarta.servlet.ServletException