mdt-charts 1.27.0 → 1.27.1

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.
@@ -28,7 +28,7 @@ export class TwoDimMarginModel {
28
28
  const secondaryLabelSize = this.getMaxLabelSizeSecondary(modelInstance);
29
29
  this.recalcMarginBySecondaryAxisLabelSize(secondaryLabelSize, canvasModel);
30
30
  }
31
- if (this.configReader.isValueLabelsOn() && this.configReader.options.orientation === 'vertical') {
31
+ if (this.configReader.areValueLabelsOn() && this.configReader.areValueLabelsNeedIncreaseMargin() && this.configReader.options.orientation === 'vertical') {
32
32
  this.recalcVerticalMarginWithValueLabelsOn(canvasModel);
33
33
  }
34
34
  }
@@ -23,7 +23,8 @@ export declare class TwoDimConfigReader implements BaseConfigReader {
23
23
  containsSecondaryAxis(): boolean;
24
24
  getValueLabelFormatterForChart(chartIndex: number): ValueLabelsFormatter;
25
25
  calculateDefaultAxisLabelFormatter(): AxisLabelFormatter;
26
- isValueLabelsOn(): boolean;
26
+ areValueLabelsOn(): boolean;
27
+ areValueLabelsNeedIncreaseMargin(): boolean;
27
28
  getValueLabelsStyleModel(): ValueLabelsStyleModel;
28
29
  private calculateBiggestValueAndDecremented;
29
30
  private calculateAxisLabelFormatter;
@@ -75,9 +75,12 @@ export class TwoDimConfigReader {
75
75
  const valueFieldFormat = this.options.charts[0].data.valueFields[0].format;
76
76
  return (v) => this.designerConfig.dataFormat.formatters(v, { type: valueFieldFormat });
77
77
  }
78
- isValueLabelsOn() {
78
+ areValueLabelsOn() {
79
79
  return this.options.charts.some(chart => { var _a; return (_a = chart.valueLabels) === null || _a === void 0 ? void 0 : _a.on; });
80
80
  }
81
+ areValueLabelsNeedIncreaseMargin() {
82
+ return !this.options.charts.every(chart => { var _a, _b; return ((_b = (_a = chart.valueLabels) === null || _a === void 0 ? void 0 : _a.position) === null || _b === void 0 ? void 0 : _b.mode) === "center"; });
83
+ }
81
84
  getValueLabelsStyleModel() {
82
85
  var _a, _b, _c, _d, _e, _f, _g, _h;
83
86
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdt-charts",
3
- "version": "1.27.0",
3
+ "version": "1.27.1",
4
4
  "description": "",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {