Skip to content

Add a labelColor option and id: value in ForEach for slices and rows - #1

Open
jondlew wants to merge 7 commits into
ilamanov:mainfrom
jondlew:main
Open

Add a labelColor option and id: value in ForEach for slices and rows#1
jondlew wants to merge 7 commits into
ilamanov:mainfrom
jondlew:main

Conversation

@jondlew

@jondlew jondlew commented Jul 25, 2021

Copy link
Copy Markdown

Sets default labelColor to black. Adding id: in ForEach allows the chart to redraw dynamically when data is updated.

@Yang-Xijie

Copy link
Copy Markdown

Great pull request!

This will set the frame size so a chart with many entries will render correctly inside a ScrollView
var body: some View {
VStack{
ForEach(0..<self.values.count){ i in
ForEach(0..<self.values.count, id: \.self){ i in

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above comment

VStack{
ZStack{
ForEach(0..<self.values.count){ i in
ForEach(0..<self.values.count, id:\.self){ i in

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good because it will eliminate the compiler warning Non-constant range: argument must be an integer literal

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.

3 participants