So erhöhen Sie den Abstand zwischen Etiketten und Balken in der TabelleIOS

Programmierung für iOS
Anonymous
 So erhöhen Sie den Abstand zwischen Etiketten und Balken in der Tabelle

Post by Anonymous »

Wie erhöhe ich den Abstand zwischen den Etiketten und den Balken? Ddnam2d4.png " /> < /p>

Code: Select all

    var body: some View {
if sections.count > 4 {
defaultBody().aspectRatio(1, contentMode: .fill)
} else {
// when there are too little items, aspect ratio above makes the chart look too spaced out, so we don't use it
defaultBody()
}
}

private func defaultBody() -> some View {
Chart(sections) { section in
BarMark(x: .value("Price", section.header.totalPrice * progress),
y: .value("Category", section.header.name))
.foregroundStyle(Theme.accentSec)
.position(by: .value("Alignment", 0))
}
.chartLegend(.hidden)
.chartXAxis(.hidden)
.chartXScale(domain: .automatic(dataType: Float.self, modifyInferredDomain: { $0 = [0, max] }))
.chartYAxis {
AxisMarks { _ in
AxisValueLabel()
.foregroundStyle(Color.black)
}
}
.onAppear {
animateChart()
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post