1 | if (data != null) {↵ | | 1 | if (data != null) {↵
|
2 | PlotOrientation orientation = plot.getOrientation();↵ | | 2 | PlotOrientation orientation = plot.getOrientation();↵
|
3 | double space = 0.0;↵ | | 3 | double space = 0.0;↵
|
4 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | | 4 | if (orientation == PlotOrientation.HORIZONTAL) {↵
|
5 | space = dataArea.getHeight();↵ | | 5 | space = dataArea.getHeight();↵
|
6 | }↵ | | 6 | }↵
|
7 | else if (orientation == PlotOrientation.VERTICAL) {↵ | | 7 | else if (orientation == PlotOrientation.VERTICAL) {↵
|
8 | space = dataArea.getWidth();↵ | | 8 | space = dataArea.getWidth();↵
|
9 | }↵ | | 9 | }↵
|
10 | double maxWidth = space * getMaximumBarWidth();↵ | | 10 | double maxWidth = space * getMaximumBarWidth();↵
|
11 | int columns = data.getColumnCount();↵ | | 11 | int columns = data.getColumnCount();↵
|
12 | double categoryMargin = 0.0;↵ | | 12 | double categoryMargin = 0.0;↵
|
13 | if (columns > 1) {↵ | | 13 | if (columns > 1) {↵
|
14 | categoryMargin = xAxis.getCategoryMargin();↵ | | 14 | categoryMargin = domainAxis.getCategoryMargin();↵
|
15 | }↵ | | 15 | }↵
|
|
16 | double used = space * (1 - xAxis.getLowerMargin()↵ | | 16 | double used = space * (1 - domainAxis.getLowerMargin()↵
|
17 | - xAxis.getUpperMargin()↵ | | 17 | - domainAxis.getUpperMargin()↵
|
18 | - categoryMargin);↵ | | 18 | - categoryMargin);↵
|
19 | if (columns > 0) {↵ | | 19 | if (columns > 0) {↵
|
20 | state.setBarWidth(Math.min(used / columns, maxWidth));↵ | | 20 | state.setBarWidth(Math.min(used / columns, maxWidth));↵
|
21 | }↵ | | 21 | }↵
|
22 | else {↵ | | 22 | else {↵
|
23 | state.setBarWidth(Math.min(used, maxWidth));↵ | | 23 | state.setBarWidth(Math.min(used, maxWidth));↵
|
24 | | | 24 |
|