evui 3.3.15 → 3.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "3.3.15",
3
+ "version": "3.3.16",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -189,8 +189,8 @@ class EvChart {
189
189
  break;
190
190
  }
191
191
  case 'bar': {
192
- const { thickness, borderRadius } = this.options;
193
- series.draw({ thickness, borderRadius, showSeriesCount, showIndex, ...opt });
192
+ const { thickness, cPadRatio, borderRadius } = this.options;
193
+ series.draw({ thickness, cPadRatio, borderRadius, showSeriesCount, showIndex, ...opt });
194
194
  if (series.show) {
195
195
  showIndex++;
196
196
  }
@@ -67,7 +67,14 @@ class Bar {
67
67
 
68
68
  const dArea = isHorizontal ? yArea : xArea;
69
69
  const cArea = dArea / (this.data.length || 1);
70
- const cPad = 2;
70
+
71
+ let cPad;
72
+ const isUnableToDrawCategoryPadding = param.cPadRatio >= 1 || param.cPadRatio <= 0;
73
+ if (isUnableToDrawCategoryPadding) {
74
+ cPad = 2;
75
+ } else {
76
+ cPad = Math.max((dArea * (param.cPadRatio / 2)) / this.data.length, 2);
77
+ }
71
78
 
72
79
  let bArea;
73
80
  let w;
@@ -43,6 +43,7 @@ const DEFAULT_OPTIONS = {
43
43
  width: '100%',
44
44
  height: '100%',
45
45
  thickness: 1,
46
+ cPadRatio: 0,
46
47
  borderRadius: 0,
47
48
  combo: false,
48
49
  tooltip: {