Swift Charts how do I set the column thickness?

79 Views Asked by At

Tell me how to set the column thickness fixed so that the columns are always the same size. I have one column for almost the entire graph, and when there are many columns, they become very narrow, and it is necessary that there always be one size. If there are examples of working code, I would appreciate it.

I'm trying to find the answer to how to set the size and I can't find it

1

There are 1 best solutions below

0
Radioactive On

Solutions:

1. You can set it to fixed so it doesn't change the width no matter what

BarMark(/*your data*/, width: .fixed(10))    

2. You can set it to inset so the column makes horizontal padding to the given column space

BarMark(/*your data*/, width: .inset(10))

3. You can set it to ratio so it ratios the column width to horizontal column space

BarMark(/*your data*/, width: .ratio(0.7))