mdt-charts 1.12.15 → 1.12.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.
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Legend } from "../../../config/config";
|
|
1
2
|
import { LegendBlockModel } from "../../model";
|
|
2
3
|
import { ModelInstance } from "../../modelInstance/modelInstance";
|
|
3
4
|
export declare class TwoDimLegendModel {
|
|
4
|
-
recalcMarginWith2DLegend(modelInstance: ModelInstance, legendBlockModel: LegendBlockModel): void;
|
|
5
|
+
recalcMarginWith2DLegend(modelInstance: ModelInstance, legendBlockModel: LegendBlockModel, legendOptions: Legend): void;
|
|
5
6
|
private getLegendSize;
|
|
6
7
|
private getLegendModel;
|
|
7
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LegendModel } from "./legendModel";
|
|
2
2
|
export class TwoDimLegendModel {
|
|
3
|
-
recalcMarginWith2DLegend(modelInstance, legendBlockModel) {
|
|
3
|
+
recalcMarginWith2DLegend(modelInstance, legendBlockModel, legendOptions) {
|
|
4
4
|
const canvasModel = modelInstance.canvasModel;
|
|
5
|
-
const legendPosition = this.getLegendModel().position;
|
|
5
|
+
const legendPosition = this.getLegendModel(legendOptions).position;
|
|
6
6
|
modelInstance.canvasModel.legendCanvas.setPosition(legendPosition);
|
|
7
7
|
if (legendPosition !== 'off') {
|
|
8
8
|
const legendSize = this.getLegendSize();
|
|
@@ -16,9 +16,10 @@ export class TwoDimLegendModel {
|
|
|
16
16
|
const heightOfLegendItemWithoutWordWrapping = 20;
|
|
17
17
|
return heightOfLegendItemWithoutWordWrapping;
|
|
18
18
|
}
|
|
19
|
-
getLegendModel() {
|
|
19
|
+
getLegendModel(legendOptions) {
|
|
20
|
+
const position = legendOptions.show ? "top" : "off";
|
|
20
21
|
return {
|
|
21
|
-
position
|
|
22
|
+
position
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -12,7 +12,7 @@ export class TwoDimMarginModel {
|
|
|
12
12
|
}
|
|
13
13
|
recalcMargin(designerConfig, options, otherComponents, data, modelInstance) {
|
|
14
14
|
const canvasModel = modelInstance.canvasModel;
|
|
15
|
-
this.twoDimLegendModel.recalcMarginWith2DLegend(modelInstance, otherComponents.legendBlock);
|
|
15
|
+
this.twoDimLegendModel.recalcMarginWith2DLegend(modelInstance, otherComponents.legendBlock, options.legend);
|
|
16
16
|
const labelSize = this.getHorizontalMarginByAxisLabels(designerConfig.canvas.axisLabel.maxSize.main, options.axis, data, options);
|
|
17
17
|
this.recalcVerticalMarginByAxisLabelHeight(labelSize, canvasModel, options.orientation, options.axis);
|
|
18
18
|
// Если встроенный лейбл показывает ключи, то лейблы оси ключей не показываются
|