Skip to content

feat: android charts#94

Open
DorianMazur wants to merge 2 commits intocallstackincubator:feat/chartsfrom
DorianMazur:feat/android-charts
Open

feat: android charts#94
DorianMazur wants to merge 2 commits intocallstackincubator:feat/chartsfrom
DorianMazur:feat/android-charts

Conversation

@DorianMazur
Copy link

@DorianMazur DorianMazur commented Mar 5, 2026

Android Chart Implementation

Implements the Android counterpart to the iOS Chart component added in feat/charts. Supports bar, line, area, point, rule, and sector (pie/donut) mark types inside Glance widgets.

Approach

Jetpack Glance has no charting API, so charts are rendered to a Bitmap via Android Canvas and displayed as a Glance Image using Icon.createWithBitmap().

  • ChartBitmapRenderer.kt — core Canvas drawing engine for all 6 mark types, axes, grid lines, labels, and color palette
  • ChartRenderers.kt — Glance composable that reads style/props, renders the bitmap, and outputs an Image
  • ChartParameters.kt — generated parameter model

Chart dimensions come from the style prop. Bitmaps are capped at 600px to stay within RemoteViews parcel limits.

TypeScript

  • VoltraAndroid.Chart and mark components (BarMark, LineMark, AreaMark, PointMark, RuleMark, SectorMark) in the Android namespace
  • Shares types and wire format with the iOS Voltra.Chart from feat/charts

Example app

  • AndroidChartWidget.tsx — 4 widget variants (bar, line, area, pie)
  • AndroidChartScreen.tsx — interactive preview with chart type and size selectors
Bar Line Area Pie
image image image image
  • Widget registered as chart_widget in app.json with initial state

@vercel
Copy link

vercel bot commented Mar 5, 2026

@DorianMazur is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@DorianMazur DorianMazur marked this pull request as ready for review March 5, 2026 20:06
@Angelk90
Copy link

Angelk90 commented Mar 7, 2026

@DorianMazur : Great work, you can post videos of them in use on the home.

When I run:
npx expo prebuild --platform=android

In voltra/example, i get:

✖ Prebuild failed
Error: [android.dangerous]: withAndroidDangerousBaseMod: Failed to prerender widget state for 
chart_widget (./widgets/android-chart-widget-initial.tsx): Unsupported element type "undefined".
Report this as a bug in the Voltra project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants