... | ... | @@ -55,25 +55,24 @@ baseSize = reqSize(thickness=0) = (g-1) * gpad + SUM(0 <= i < g, (b[i] - 1) * bp |
|
|
= g * (gpad - bpad) + (b * bpad) + 2 - gpad
|
|
|
```
|
|
|
|
|
|
This base size is the required size for all paddings. The required size can now be represented much simpler:
|
|
|
This `baseSize(g, gpad, b, bpad) = g * (gpad - bpad) + (b * bpad) + 2 - gpad` which does not depend on the actual arrangement of the groups and bars represents the required size for all paddings. The required size can now be represented much simpler as the sum of the base size and the required bar space:
|
|
|
|
|
|
```
|
|
|
reqSize(thickness) = baseSize + b * tickness
|
|
|
reqSize(thickness) = baseSize + b * thickness
|
|
|
```
|
|
|
|
|
|
Of course a limit for the total size by the available chart area `availableSize`. This means:
|
|
|
Of course a limit for the total size is given by the available chart area `availableSize`. This means:
|
|
|
```
|
|
|
reqSize(thickness) <= availableSize
|
|
|
baseSize + b * tickness <= availableSize
|
|
|
baseSize + b * thickness <= availableSize
|
|
|
|
|
|
// minus baseSize
|
|
|
b * tickness <= (availableSize - baseSize)
|
|
|
b * thickness <= (availableSize - baseSize)
|
|
|
|
|
|
// divide by total amount of bars b
|
|
|
tickness <= (availableSize - baseSize) / b
|
|
|
thickness <= (availableSize - baseSize) / b
|
|
|
|
|
|
// The maximum possible thickness is wanted. But it also must be a whole number.
|
|
|
|
|
|
thickness = floor((availableSize - baseSize) / b)
|
|
|
```
|
|
|
|
... | ... | |