I have a Swift Charts bar chart that looks great when there is a narrow gap between vertical bars but not so good when gaps either get large or go away altogether. Have been trying to figure out how to make bars resize with window so that narrow gaps are maintained. Seems like this should work:
BarMark(
x: .value("Year", barSegment.age),
y: .value("PercentSuccess", barSegment.percentage),
width: MarkDimension.inset(CGFloat(10.0))
)
In practice, though, this just ends up producing fixed width bars. Have also tried:
BarMark(
x: .value("Year", barSegment.age),
y: .value("PercentSuccess", barSegment.percentage),
width: MarkDimension.ratio(CGFloat(0.9))
)
But this doesn't show bars at all, regardless of what argument I give to ratio.
How do I get the effect that I want?