Skip to content

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented May 6, 2025

The following files were modified by the accessibility bot:

  • ./ChartView.swift
View changes
diff --git a/ChartView.swift b/ChartView.swift
index 8b5bdee..d372f02 100644
--- a/ChartView.swift
+++ b/ChartView.swift
@@ -22,6 +22,10 @@ struct ChartView: View {
 		  x: .value("Amount", category.amount)
 		)
 		.foregroundStyle(category.color)
+        .accessibilityLabel(Text(category.name))
+        .accessibilityValue(Text("\(category.amount, specifier: "%.2f")"))
+        .accessibilityAddTraits(.isButton)
+        .accessibilityIdentifier("BarMark_\(category.name)")
 	  }
 	  .chartPlotStyle { plotArea in
 		plotArea
@@ -31,6 +35,10 @@ struct ChartView: View {
 	  .chartXScale(domain: 0...totalAmount)
 	  .chartXAxis(.hidden)
 	  .frame(height: 25)
+      .accessibilityElement(children: .contain)
+      .accessibilityLabel(Text("Category Amounts Bar Chart"))
+      .accessibilityHint(Text("Tap a bar to select a category."))
+      .accessibilityIdentifier("CategoryBarChart")
 	  .chartOverlay { proxy in
 		GeometryReader { geometry in
 		  Rectangle().fill(.clear).contentShape(Rectangle())
@@ -50,6 +58,7 @@ struct ChartView: View {
 				}
 			  }
 			}
+            .accessibilityHidden(true)
 		}
 	  }
 	}

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