Class MultiStageTimeSeries.TrendChart
- All Implemented Interfaces:
org.kohsuke.stapler.HttpResponse
- Enclosing class:
MultiStageTimeSeries
MultiStageTimeSeries.
This object is renderable as HTTP response.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal org.jfree.data.category.DefaultCategoryDatasetfinal List<MultiStageTimeSeries> -
Constructor Summary
ConstructorsConstructorDescriptionTrendChart(MultiStageTimeSeries.TimeScale timeScale, MultiStageTimeSeries... series) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.jfree.chart.axis.CategoryAxisconfigureDomainAxis(org.jfree.chart.plot.CategoryPlot plot) protected voidconfigurePlot(org.jfree.chart.plot.CategoryPlot plot) protected voidconfigureRangeAxis(org.jfree.chart.axis.NumberAxis rangeAxis) protected voidconfigureRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer renderer) org.jfree.chart.JFreeChartDraws a chart intoJFreeChart.protected org.jfree.data.category.DefaultCategoryDatasetCreates aDefaultCategoryDatasetfor rendering a graph from a set ofMultiStageTimeSeries.Renders the chart legend as an HTML fragment (a swatch and label per series).Renders this trend chart as an inline SVG document.protected voidcrop(org.jfree.chart.plot.CategoryPlot plot) voidgenerateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node) Renders this object as an image.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kohsuke.stapler.HttpResponse
generateResponse
-
Field Details
-
timeScale
-
series
-
dataset
public final org.jfree.data.category.DefaultCategoryDataset dataset
-
-
Constructor Details
-
TrendChart
-
-
Method Details
-
createDataset
protected org.jfree.data.category.DefaultCategoryDataset createDataset()Creates aDefaultCategoryDatasetfor rendering a graph from a set ofMultiStageTimeSeries. -
createChart
public org.jfree.chart.JFreeChart createChart()Draws a chart intoJFreeChart. -
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
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 theviewBoxlets it scale fluidly with its container instead of being a fixed-size raster. -
createLegendHtml
Renders the chart legend as an HTML fragment (a swatch and label per series).The legend lives in HTML rather than inside the
SVGso the browser measures each label natively and reflows items withflex-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 therole="img"SVG as an opaque image and never exposes text drawn inside it. -
createSvgWithLegend
-
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:
generateResponsein interfaceorg.kohsuke.stapler.HttpResponse- Throws:
IOExceptionjakarta.servlet.ServletException
-