Class SunburstRenderer

java.lang.Object
com.arbergashi.charts.render.BaseRenderer
com.arbergashi.charts.render.circular.SunburstRenderer
All Implemented Interfaces:
ChartRenderer

public final class SunburstRenderer extends BaseRenderer

Modern Sunburst Renderer

Draws a professional, interactive, and zero-allocation sunburst chart for hierarchical data.

Features:

  • Interactive Drill-Down: Click segments to zoom in/out of the hierarchy.
  • Path Highlighting: Highlights the entire path to a segment on hover.
  • Smart Labels: Rotates and fits labels within segments.
  • Dynamic Layout: Ring thickness adapts to hierarchy depth.
Since:
2024-06-01
Version:
1.0.0
Author:
Arber Gashi
  • Constructor Details

    • SunburstRenderer

      public SunburstRenderer()
  • Method Details

    • drawData

      protected void drawData(Graphics2D g2, ChartModel model, PlotContext context)
      Description copied from class: BaseRenderer
      Implementation-specific drawing logic. Must follow Zero-Allocation rules.
      Specified by:
      drawData in class BaseRenderer
    • getPointAt

      public Optional<Integer> getPointAt(Point2D pixel, ChartModel model, PlotContext context)
      Description copied from class: BaseRenderer
      Returns the data index nearest to the given pixel coordinate, if supported.
      Specified by:
      getPointAt in interface ChartRenderer
      Overrides:
      getPointAt in class BaseRenderer
      Parameters:
      pixel - mouse/crosshair position in component coordinates
      model - data model for this layer
      context - current plot context
      Returns:
      optional point index
    • clearHover

      public void clearHover()
      Description copied from interface: ChartRenderer
      Clears any hover/highlight state.
    • handleClick

      public void handleClick(Point2D pixel, PlotContext context)
      Handles a click event to perform drill-down/up operations.
      Parameters:
      pixel - The point that was clicked.
      context - The current plot context.