Class SemiDonutRenderer
java.lang.Object
com.arbergashi.charts.render.BaseRenderer
com.arbergashi.charts.render.circular.SemiDonutRenderer
- All Implemented Interfaces:
ChartRenderer
Modern Semi-Donut Renderer
Draws a professional, interactive semi-donut chart, ideal for progress indicators and KPIs. Adheres to strict zero-allocation guidelines.
Features:
- Progress Display: Shows a single value (0-100%) as a colored arc.
- Background Track: A subtle background arc indicates the 100% range.
- Center Value: The percentage value is displayed prominently in the center.
- Rounded Caps: The arc has rounded ends for a modern aesthetic.
- Since:
- 2024-06-01
- Version:
- 1.0.0
- Author:
- Arber Gashi
-
Field Summary
Fields inherited from class BaseRenderer
PIXEL_BUF, PIXEL_BUF4 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawData(Graphics2D g2, ChartModel model, PlotContext context) Implementation-specific drawing logic.getPointAt(Point2D pixel, ChartModel model, PlotContext context) Returns the data index nearest to the given pixel coordinate, if supported.booleanIndicates whether this renderer should appear in the legend.setValue(double value) Sets the value to display.Methods inherited from class BaseRenderer
drawHighlightPoint, drawI18nLabel, drawLabel, getArc, getCachedFont, getCachedGradient, getCachedStroke, getCachedStroke, getCachedStroke, getCubicCurve, getEllipse, getId, getLayerIndex, getLegendColor, getLine, getName, getPathCache, 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
-
SemiDonutRenderer
public SemiDonutRenderer()
-
-
Method Details
-
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
-
getPointAt
Description copied from class:BaseRendererReturns the data index nearest to the given pixel coordinate, if supported.- Specified by:
getPointAtin interfaceChartRenderer- Overrides:
getPointAtin classBaseRenderer- Parameters:
pixel- mouse/crosshair position in component coordinatesmodel- data model for this layercontext- current plot context- Returns:
- optional point index
-
setValue
Sets the value to display.- Parameters:
value- The value, expected to be in the range [0.0, 1.0].- Returns:
- This renderer for chaining.
-