Skip to content

feat(PieChart): add startDegree parameter#172

Open
saadkhalidkhan wants to merge 3 commits into
ehsannarmani:masterfrom
saadkhalidkhan:feat/pie-chart-start-degree
Open

feat(PieChart): add startDegree parameter#172
saadkhalidkhan wants to merge 3 commits into
ehsannarmani:masterfrom
saadkhalidkhan:feat/pie-chart-start-degree

Conversation

@saadkhalidkhan

Copy link
Copy Markdown

Summary

  • Add startDegree parameter to PieChart (default 0f = first slice at 3 o'clock)
  • Apply offset to arc drawing; use -90f to start at 12 o'clock (top)
  • Normalize tap angles for accurate slice click detection after rotation
  • Update PieSample demo and pie chart documentation

Closes #166

Commits

  1. feat(PieChart): add startDegree parameter for arc layout
  2. demo: start PieSample at 12 o'clock with startDegree -90f
  3. docs: document PieChart startDegree parameter

Test plan

  • :compose-charts:compileDebugKotlinAndroid builds successfully
  • :app:compileDebugKotlinAndroid builds successfully
  • Run app — first pie slice starts at top (12 o'clock) in PieSample
  • Tap each slice — correct segment is selected
  • Default startDegree = 0f behavior unchanged for existing callers

Allow rotating where the first slice begins. Use -90f to start at 12
o'clock instead of the default 3 o'clock. Tap detection normalizes
angles against startDegree so clicks stay accurate.
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.

PieChart custom starting degree

1 participant