Skip to content

Releases: AndroidPoet/DrafterCharts

0.2.0

Choose a tag to compare

@AndroidPoet AndroidPoet released this 24 Jun 19:19

Toward a consistent, accessible charting library.

♿️ VoiceOver accessibility for every chart

A Canvas is opaque to assistive technology, so each chart is now collapsed into a single accessibility element whose label (the chart kind) and value (a data summary) come from its ChartRenderer. Charts announce e.g. "Area chart, 3 points, Jan 40, Feb 65, Mar 30" or "Gauge, Score 72 of 0 to 100" with no work at the call site. ChartRenderer gains accessibilityLabel / accessibilityValue (both with defaults) so custom renderers describe themselves the same way.

🧩 One consistent, bare initializer API (breaking)

The remaining charts that took a data: SomeStructData(...) wrapper now take their bound elements directly, matching the point/series charts:

  • PieChart(slices:) / DonutChart(slices:) — new top-level PieSlice
  • GaugeChart(value:min:max:label:color:)
  • FunnelChart(stages:), TreemapChart(items:), SunburstChart(roots:), BulletChart(metrics:), BoxPlotChart(groups:), PolarAreaChart(slices:)
  • SankeyChart(nodes:links:), CandlestickChart(candles:movingAverages:), BubbleChart(series:), Heatmap(contributions:baseColor:backgroundSquareColor:)

The 12 *Data wrapper structs were removed; the element types are unchanged.

Migration: drop the data: wrapper — PieChart(data: PieChartData(slices: s))PieChart(slices: s).

Full notes in CHANGELOG.md.

DrafterCharts 0.1.0

Choose a tag to compare

@AndroidPoet AndroidPoet released this 24 Jun 19:01

First public (pre-1.0) release. While the version is 0.x, the API may still change between minor releases.

Type-safe, point-based API

Charts take bound elements instead of parallel labels/values/colors arrays, so a label can never desync from its value and a color can never index past its data — the mismatch is unrepresentable:

LineChart(points: [ChartPoint("Jan", 40), ChartPoint("Feb", 65)])
GroupedBarChart(series: [ChartSeries(name: "2024", color: .blue, values: [28, 30, 38, 44])], categories: ["Q1","Q2","Q3","Q4"])
WaterfallChart(steps: [WaterfallStep("Sales", 60), WaterfallStep("Costs", -25)], initialValue: 50, startLabel: "Start", totalLabel: "Net")
  • Single-series: [ChartPoint] (Area, Line, StepLine). Multi-series: [ChartSeries] + optional categories (Grouped/Stacked Line, Grouped/Stacked Bar, StreamGraph). SimpleBar[BarItem], Waterfall[WaterfallStep], Scatter[ScatterPoint], Radar[RadarSeries], Gantt[GanttTask] (per-task color).
  • values:-first convenience initializers for the simplest charts.
  • WaterfallChart Start/Total bookend bars via startLabel/totalLabel.

27 chart types

Built on pure SwiftUI Canvas with Catmull-Rom smoothing, gradient fills, reveal animations, and light/dark theming. Zero dependencies.

Install: Swift Package Manager — https://github.com/AndroidPoet/DrafterCharts, pin to 0.1.0.