Class GaugeRenderer
java.lang.Object
com.arbergashi.charts.render.BaseRenderer
com.arbergashi.charts.render.circular.GaugeRenderer
- All Implemented Interfaces:
ChartRenderer, ActionListener, HierarchyListener, EventListener
Modern Gauge Renderer
Draws a professional, highly configurable radial gauge, adhering to strict zero-allocation guidelines.
Features:
- Configurable Bands: Define colored ranges (e.g., green, yellow, red).
- Custom Range: Explicitly set the min/max values for the gauge scale.
- Modern Needle: A sleek, animated needle design.
- Center Value Display: Prominently displays the current value and unit.
- Since:
- 2025-06-01
- Version:
- 1.0.0
- Author:
- Arber Gashi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDefines a colored value band on the gauge scale. -
Field Summary
Fields inherited from class BaseRenderer
PIXEL_BUF, PIXEL_BUF4 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voiddrawData(Graphics2D g2, ChartModel model, PlotContext context) Implementation-specific drawing logic.voidbooleanIndicates whether this renderer should appear in the legend.setBands(List<GaugeRenderer.Band> bands) setRange(double min, double max) setValue(double value) Methods inherited from class BaseRenderer
drawHighlightPoint, drawI18nLabel, drawLabel, getArc, getCachedFont, getCachedGradient, getCachedStroke, getCachedStroke, getCachedStroke, getCubicCurve, getEllipse, getId, getLayerIndex, getLegendColor, getLine, getName, getPathCache, getPointAt, getRect, getRoundRectangle, getSeriesColor, getSeriesStroke, getTheme, getTooltipText, isMultiColor, pBuffer, pBuffer4, render, resolveTheme, seriesOrBase, setLayerIndex, setMultiColor, setTheme, setupQualityHints, themeAccent, themeAxisLabel, themeBackground, themeBearish, themeBullish, themeForeground, themeGrid, themeSeriesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChartRenderer
clearHover, createContext, getFocusValues, getPreferredYRange, renderEmptyState, supportsEmptyState
-
Constructor Details
-
GaugeRenderer
public GaugeRenderer()
-
-
Method Details
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
hierarchyChanged
- Specified by:
hierarchyChangedin interfaceHierarchyListener
-
isLegendRequired
public boolean isLegendRequired()Description copied from class:BaseRendererIndicates whether this renderer should appear in the legend.- Specified by:
isLegendRequiredin interfaceChartRenderer- Overrides:
isLegendRequiredin classBaseRenderer- Returns:
- true if the renderer should appear in the legend
-
drawData
Description copied from class:BaseRendererImplementation-specific drawing logic. Must follow Zero-Allocation rules.- Specified by:
drawDatain classBaseRenderer
-
setRange
-
setValue
-
setUnit
-
setBands
-