scichart 2.0.2204 → 2.0.2228

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.
Files changed (49) hide show
  1. package/Charting/Drawing/BrushCache.d.ts +8 -2
  2. package/Charting/Drawing/BrushCache.js +16 -8
  3. package/Charting/LayoutManager/BaseAxisLayoutStrategy.d.ts +2 -0
  4. package/Charting/LayoutManager/BaseAxisLayoutStrategy.js +33 -0
  5. package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  6. package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +19 -2
  7. package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +18 -2
  8. package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  9. package/Charting/Model/OhlcDataSeries.js +10 -10
  10. package/Charting/Model/XyDataSeries.js +4 -4
  11. package/Charting/Model/XyyDataSeries.js +6 -6
  12. package/Charting/Model/XyzDataSeries.js +6 -6
  13. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +1 -1
  14. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +1 -1
  15. package/Charting/Visuals/Annotations/SvgAnnotationBase.js +7 -2
  16. package/Charting/Visuals/Axis/AxisBase2D.d.ts +23 -0
  17. package/Charting/Visuals/Axis/AxisBase2D.js +71 -24
  18. package/Charting/Visuals/Axis/AxisRenderer.js +31 -4
  19. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +10 -3
  20. package/Charting/Visuals/SciChartSurface.d.ts +4 -4
  21. package/Charting/Visuals/SciChartSurface.js +18 -11
  22. package/Charting/Visuals/SciChartSurfaceBase.d.ts +3 -2
  23. package/Charting/Visuals/SciChartSurfaceBase.js +4 -4
  24. package/Charting/Visuals/createMaster.d.ts +1 -1
  25. package/Charting/Visuals/createMaster.js +11 -6
  26. package/Charting/Visuals/createSingle.d.ts +1 -1
  27. package/Charting/Visuals/createSingle.js +2 -2
  28. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  29. package/Charting/Visuals/sciChartInitCommon.js +18 -12
  30. package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
  31. package/Charting3D/Visuals/SciChart3DSurface.js +3 -3
  32. package/Charting3D/Visuals/createMaster3d.d.ts +1 -1
  33. package/Charting3D/Visuals/createMaster3d.js +11 -6
  34. package/Charting3D/Visuals/createSingle3d.d.ts +1 -1
  35. package/Charting3D/Visuals/createSingle3d.js +2 -2
  36. package/Core/BuildStamp.d.ts +1 -1
  37. package/Core/BuildStamp.js +2 -2
  38. package/Core/NumberRange.d.ts +1 -0
  39. package/Core/NumberRange.js +8 -0
  40. package/_wasm/scichart.browser.js +1 -1
  41. package/_wasm/scichart2d.js +95 -95
  42. package/_wasm/scichart2d.wasm +0 -0
  43. package/_wasm/scichart3d.js +95 -95
  44. package/_wasm/scichart3d.wasm +0 -0
  45. package/package.json +1 -1
  46. package/types/NumberArray.d.ts +1 -0
  47. package/types/NumberArray.js +5 -1
  48. package/types/TStackedAxisLength.d.ts +4 -0
  49. package/types/TStackedAxisLength.js +4 -0
@@ -10,14 +10,18 @@ export declare class BrushCache extends BaseCache<WebGlBrush> {
10
10
  private opacity;
11
11
  private fillLinearGradient;
12
12
  private canvasTexture;
13
+ private textureHeightRatio;
14
+ private textureWidthRatio;
13
15
  get value(): WebGlBrush;
14
16
  /**
15
17
  * Creates or fetches a new brush with the specified params
16
18
  * @param fill
17
19
  * @param opacity
20
+ * @param textureHeightRatio
21
+ * @param textureWidthRatio
18
22
  * @param fillLinearGradient
19
23
  */
20
- create(fill: string, opacity: number, fillLinearGradient?: GradientParams): WebGlBrush;
24
+ create(fill: string, opacity: number, textureHeightRatio?: number, textureWidthRatio?: number, fillLinearGradient?: GradientParams): WebGlBrush;
21
25
  invalidateCache(): void;
22
26
  reset(): void;
23
27
  delete(): void;
@@ -43,7 +47,9 @@ export declare const getScrtBrushFromCache: (cache: BrushCache) => SCRTBrush;
43
47
  * @param cache The object that will store a brush
44
48
  * @param fill The HTML Color code
45
49
  * @param opacity The opacity factor.
50
+ * @param textureHeightRatio The height ratio of the main canvas to the WebGl canvas.
51
+ * @param textureWidthRatio The width ratio of the main canvas to the WebGl canvas.
46
52
  * @param fillGradientLinear The gradient params.
47
53
  * @returns new or existing instance of {@link SCRTBrush}}
48
54
  */
49
- export declare const createBrushInCache: (cache: BrushCache, fill: string, opacity: number, fillGradientLinear?: GradientParams) => SCRTBrush;
55
+ export declare const createBrushInCache: (cache: BrushCache, fill: string, opacity: number, textureHeightRatio?: number, textureWidthRatio?: number, fillGradientLinear?: GradientParams) => SCRTBrush;
@@ -35,7 +35,7 @@ var BrushCache = /** @class */ (function (_super) {
35
35
  Object.defineProperty(BrushCache.prototype, "value", {
36
36
  get: function () {
37
37
  if (!this.cachedEntity && (this.fill || this.fillLinearGradient)) {
38
- this.cachedEntity = this.create(this.fill, this.opacity, this.fillLinearGradient);
38
+ this.cachedEntity = this.create(this.fill, this.opacity, this.textureHeightRatio, this.textureWidthRatio, this.fillLinearGradient);
39
39
  }
40
40
  return this.cachedEntity;
41
41
  },
@@ -46,18 +46,24 @@ var BrushCache = /** @class */ (function (_super) {
46
46
  * Creates or fetches a new brush with the specified params
47
47
  * @param fill
48
48
  * @param opacity
49
+ * @param textureHeightRatio
50
+ * @param textureWidthRatio
49
51
  * @param fillLinearGradient
50
52
  */
51
- BrushCache.prototype.create = function (fill, opacity, fillLinearGradient) {
53
+ BrushCache.prototype.create = function (fill, opacity, textureHeightRatio, textureWidthRatio, fillLinearGradient) {
52
54
  if (this.cachedEntity &&
53
55
  fill === this.fill &&
54
56
  opacity === this.opacity &&
57
+ textureHeightRatio === this.textureHeightRatio &&
58
+ textureWidthRatio === this.textureWidthRatio &&
55
59
  fillLinearGradient === this.fillLinearGradient) {
56
60
  return this.cachedEntity;
57
61
  }
58
62
  this.invalidateCache();
59
63
  this.fill = fill;
60
64
  this.opacity = opacity;
65
+ this.textureHeightRatio = textureHeightRatio;
66
+ this.textureWidthRatio = textureWidthRatio;
61
67
  this.fillLinearGradient = fillLinearGradient;
62
68
  var brush = fillLinearGradient ? this.createGradientBrush() : this.createSolidBrush(fill, opacity);
63
69
  return (this.cachedEntity = new WebGlBrush_1.WebGlBrush(brush));
@@ -89,10 +95,10 @@ var BrushCache = /** @class */ (function (_super) {
89
95
  this.canvasTexture.clear();
90
96
  var ctx = this.canvasTexture.getContext();
91
97
  // BEGIN: Drawing gradient rectangle on canvas2D
92
- var x1 = convertRelativeToAbsolute(startPoint.x, TEXTURE_SIZE);
93
- var y1 = convertRelativeToAbsolute(startPoint.y, TEXTURE_SIZE);
94
- var x2 = convertRelativeToAbsolute(endPoint.x, TEXTURE_SIZE);
95
- var y2 = convertRelativeToAbsolute(endPoint.y, TEXTURE_SIZE);
98
+ var x1 = convertRelativeToAbsolute(startPoint.x, TEXTURE_SIZE * this.textureWidthRatio);
99
+ var y1 = convertRelativeToAbsolute(startPoint.y, TEXTURE_SIZE * this.textureHeightRatio);
100
+ var x2 = convertRelativeToAbsolute(endPoint.x, TEXTURE_SIZE * this.textureWidthRatio);
101
+ var y2 = convertRelativeToAbsolute(endPoint.y, TEXTURE_SIZE * this.textureHeightRatio);
96
102
  var gradient = ctx.createLinearGradient(x1, y1, x2, y2);
97
103
  gradientStops.forEach(function (el) {
98
104
  gradient.addColorStop(el.offset, el.color);
@@ -133,12 +139,14 @@ exports.getScrtBrushFromCache = getScrtBrushFromCache;
133
139
  * @param cache The object that will store a brush
134
140
  * @param fill The HTML Color code
135
141
  * @param opacity The opacity factor.
142
+ * @param textureHeightRatio The height ratio of the main canvas to the WebGl canvas.
143
+ * @param textureWidthRatio The width ratio of the main canvas to the WebGl canvas.
136
144
  * @param fillGradientLinear The gradient params.
137
145
  * @returns new or existing instance of {@link SCRTBrush}}
138
146
  */
139
- var createBrushInCache = function (cache, fill, opacity, fillGradientLinear) {
147
+ var createBrushInCache = function (cache, fill, opacity, textureHeightRatio, textureWidthRatio, fillGradientLinear) {
140
148
  Guard_1.Guard.notNull(cache, "brushCache");
141
- var brush = cache.create(fill, opacity, fillGradientLinear);
149
+ var brush = cache.create(fill, opacity, textureHeightRatio, textureWidthRatio, fillGradientLinear);
142
150
  return brush.scrtBrush;
143
151
  };
144
152
  exports.createBrushInCache = createBrushInCache;
@@ -36,4 +36,6 @@ export declare abstract class BaseAxisLayoutStrategy {
36
36
  protected layoutAxesFromTopToBottom(left: number, top: number, right: number, bottom: number, axes: AxisBase2D[]): void;
37
37
  protected layoutAxesFromLeftToRight(left: number, top: number, right: number, bottom: number, axes: AxisBase2D[]): void;
38
38
  protected layoutAxesFromRightToLeft(left: number, top: number, right: number, bottom: number, axes: AxisBase2D[]): void;
39
+ protected calculateTotalAxisHeight(axis: AxisBase2D, totalAxisAreaHeight: number): number;
40
+ protected calculateTotalAxisWidth(axis: AxisBase2D, totalAxisAreaHeight: number): number;
39
41
  }
@@ -56,6 +56,39 @@ var BaseAxisLayoutStrategy = /** @class */ (function () {
56
56
  (0, AxisLayoutHelpers_1.layoutAxisParts)(axis, _this.layoutAxisPartsStrategy);
57
57
  });
58
58
  };
59
+ BaseAxisLayoutStrategy.prototype.calculateTotalAxisHeight = function (axis, totalAxisAreaHeight) {
60
+ return (parseSize(axis.stackedAxisLength, totalAxisAreaHeight) +
61
+ axis.axisLayoutState.additionalBottomSize +
62
+ axis.axisLayoutState.additionalTopSize);
63
+ };
64
+ BaseAxisLayoutStrategy.prototype.calculateTotalAxisWidth = function (axis, totalAxisAreaHeight) {
65
+ return (parseSize(axis.stackedAxisLength, totalAxisAreaHeight) +
66
+ axis.axisLayoutState.additionalRightSize +
67
+ axis.axisLayoutState.additionalLeftSize);
68
+ };
59
69
  return BaseAxisLayoutStrategy;
60
70
  }());
61
71
  exports.BaseAxisLayoutStrategy = BaseAxisLayoutStrategy;
72
+ var parseSize = function (value, containerSize) {
73
+ if (typeof value === "number") {
74
+ if (value < 0) {
75
+ throw new Error("stackedAxisLength must be a positive value!");
76
+ }
77
+ return value;
78
+ }
79
+ if (value.includes("%")) {
80
+ return parsePc(value, containerSize);
81
+ }
82
+ var parsedValue = parseFloat(value);
83
+ if (!isNaN(parsedValue)) {
84
+ return parsedValue;
85
+ }
86
+ throw new Error("stackedAxisLength must be a number or a percentage");
87
+ };
88
+ var parsePc = function (value, containerSize) {
89
+ var parsedPercentageValue = parseFloat(value);
90
+ if (parsedPercentageValue < 0 || parsedPercentageValue > 100) {
91
+ throw new Error("stackedAxisLength percentage must be from 0 to 100");
92
+ }
93
+ return Math.round((containerSize * parsedPercentageValue) / 10) / 10;
94
+ };
@@ -50,14 +50,30 @@ var BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy = /** @class */ (fun
50
50
  BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
51
51
  var _this = this;
52
52
  var totalAxisAreaWidth = right - left;
53
- var singleAxisReservedWidth = totalAxisAreaWidth / axes.length;
54
53
  var firstAxis = axes[0];
54
+ var lastAxis = axes[axes.length - 1];
55
+ var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
56
+ var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaWidth +
57
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
58
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize));
59
+ var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisWidth(axis, spaceWithoutBorders); }, 0);
60
+ var availableSpaceForAxes = totalAxisAreaWidth +
61
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
62
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize) -
63
+ totalDefinedAxesLength;
64
+ if (availableSpaceForAxes < 0) {
65
+ throw new Error("Bottom stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
66
+ }
67
+ var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
55
68
  var leftOffset = left - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize);
56
69
  axes.forEach(function (axis) {
57
70
  var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalLeftSize = _a.additionalLeftSize, additionalRightSize = _a.additionalRightSize, additionalTopSize = _a.additionalTopSize;
58
71
  var topOffset = top + additionalTopSize;
59
72
  var bottomOffset = topOffset + axisSize;
60
- var rightOffset = leftOffset + singleAxisReservedWidth - additionalRightSize;
73
+ var axisReservedHeight = axis.stackedAxisLength
74
+ ? _this.calculateTotalAxisWidth(axis, spaceWithoutBorders)
75
+ : defaultAxisReservedHeight;
76
+ var rightOffset = leftOffset + axisReservedHeight - additionalRightSize;
61
77
  leftOffset += additionalLeftSize;
62
78
  axis.offset = leftOffset - left;
63
79
  axis.axisLength = rightOffset - leftOffset;
@@ -49,15 +49,32 @@ var LeftAlignedOuterVerticallyStackedAxisLayoutStrategy = /** @class */ (functio
49
49
  };
50
50
  LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
51
51
  var _this = this;
52
+ // doesn't include top border of the first and bottom border of the last axis
52
53
  var totalAxisAreaHeight = bottom - top;
53
- var singleAxisReservedHeight = totalAxisAreaHeight / axes.length;
54
54
  var firstAxis = axes[0];
55
+ var lastAxis = axes[axes.length - 1];
56
+ var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
57
+ var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaHeight +
58
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
59
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize));
60
+ var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisHeight(axis, spaceWithoutBorders); }, 0);
61
+ var availableSpaceForAxes = totalAxisAreaHeight +
62
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
63
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize) -
64
+ totalDefinedAxesLength;
65
+ if (availableSpaceForAxes < 0) {
66
+ throw new Error("Left stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
67
+ }
68
+ var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
55
69
  var topOffset = top - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize);
56
70
  axes.forEach(function (axis) {
57
71
  var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalRightSize = _a.additionalRightSize, additionalBottomSize = _a.additionalBottomSize, additionalTopSize = _a.additionalTopSize;
58
72
  var rightOffset = right - additionalRightSize;
59
73
  var leftOffset = rightOffset - axisSize;
60
- var bottomOffset = topOffset + singleAxisReservedHeight - additionalBottomSize;
74
+ var axisReservedHeight = axis.stackedAxisLength
75
+ ? _this.calculateTotalAxisHeight(axis, spaceWithoutBorders)
76
+ : defaultAxisReservedHeight;
77
+ var bottomOffset = topOffset + axisReservedHeight - additionalBottomSize;
61
78
  topOffset += additionalTopSize;
62
79
  axis.offset = topOffset - top;
63
80
  axis.axisLength = bottomOffset - topOffset;
@@ -50,14 +50,30 @@ var RightAlignedOuterVerticallyStackedAxisLayoutStrategy = /** @class */ (functi
50
50
  RightAlignedOuterVerticallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
51
51
  var _this = this;
52
52
  var totalAxisAreaHeight = bottom - top;
53
- var singleAxisReservedHeight = totalAxisAreaHeight / axes.length;
54
53
  var firstAxis = axes[0];
54
+ var lastAxis = axes[axes.length - 1];
55
+ var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
56
+ var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaHeight +
57
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
58
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize));
59
+ var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisHeight(axis, spaceWithoutBorders); }, 0);
60
+ var availableSpaceForAxes = totalAxisAreaHeight +
61
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
62
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize) -
63
+ totalDefinedAxesLength;
64
+ if (availableSpaceForAxes < 0) {
65
+ throw new Error("Right stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
66
+ }
67
+ var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
55
68
  var topOffset = top - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize);
56
69
  axes.forEach(function (axis) {
57
70
  var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalLeftSize = _a.additionalLeftSize, additionalBottomSize = _a.additionalBottomSize, additionalTopSize = _a.additionalTopSize;
58
71
  var leftOffset = left + additionalLeftSize;
59
72
  var rightOffset = leftOffset + axisSize;
60
- var bottomOffset = topOffset + singleAxisReservedHeight - additionalBottomSize;
73
+ var axisReservedHeight = axis.stackedAxisLength
74
+ ? _this.calculateTotalAxisHeight(axis, spaceWithoutBorders)
75
+ : defaultAxisReservedHeight;
76
+ var bottomOffset = topOffset + axisReservedHeight - additionalBottomSize;
61
77
  topOffset += additionalTopSize;
62
78
  axis.offset = topOffset - top;
63
79
  axis.axisLength = bottomOffset - topOffset;
@@ -50,14 +50,30 @@ var TopAlignedOuterHorizontallyStackedAxisLayoutStrategy = /** @class */ (functi
50
50
  TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
51
51
  var _this = this;
52
52
  var totalAxisAreaWidth = right - left;
53
- var singleAxisReservedWidth = totalAxisAreaWidth / axes.length;
54
53
  var firstAxis = axes[0];
54
+ var lastAxis = axes[axes.length - 1];
55
+ var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
56
+ var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaWidth +
57
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
58
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize));
59
+ var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisWidth(axis, spaceWithoutBorders); }, 0);
60
+ var availableSpaceForAxes = totalAxisAreaWidth +
61
+ (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
62
+ (lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize) -
63
+ totalDefinedAxesLength;
64
+ if (availableSpaceForAxes < 0) {
65
+ throw new Error("Top stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
66
+ }
67
+ var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
55
68
  var leftOffset = left - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize);
56
69
  axes.forEach(function (axis) {
57
70
  var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalLeftSize = _a.additionalLeftSize, additionalRightSize = _a.additionalRightSize, additionalBottomSize = _a.additionalBottomSize;
58
71
  var bottomOffset = bottom - additionalBottomSize;
59
72
  var topOffset = bottomOffset - axisSize;
60
- var rightOffset = leftOffset + singleAxisReservedWidth - additionalRightSize;
73
+ var axisReservedHeight = axis.stackedAxisLength
74
+ ? _this.calculateTotalAxisWidth(axis, spaceWithoutBorders)
75
+ : defaultAxisReservedHeight;
76
+ var rightOffset = leftOffset + axisReservedHeight - additionalRightSize;
61
77
  leftOffset += additionalLeftSize;
62
78
  axis.offset = leftOffset - left;
63
79
  axis.axisLength = rightOffset - leftOffset;
@@ -130,11 +130,11 @@ var OhlcDataSeries = /** @class */ (function (_super) {
130
130
  */
131
131
  OhlcDataSeries.prototype.appendRange = function (xValues, openValues, highValues, lowValues, closeValues, metadata) {
132
132
  if (!this.getIsDeleted()) {
133
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
134
- Guard_1.Guard.isTrue(Array.isArray(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
135
- Guard_1.Guard.isTrue(Array.isArray(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
136
- Guard_1.Guard.isTrue(Array.isArray(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
137
- Guard_1.Guard.isTrue(Array.isArray(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
133
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
134
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
135
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
136
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
137
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
138
138
  Guard_1.Guard.arraysSameLengthArr([
139
139
  { arg: xValues, name: "xValues" },
140
140
  { arg: openValues, name: "openValues" },
@@ -240,11 +240,11 @@ var OhlcDataSeries = /** @class */ (function (_super) {
240
240
  */
241
241
  OhlcDataSeries.prototype.insertRange = function (startIndex, xValues, openValues, highValues, lowValues, closeValues, metadata) {
242
242
  if (!this.getIsDeleted()) {
243
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
244
- Guard_1.Guard.isTrue(Array.isArray(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
245
- Guard_1.Guard.isTrue(Array.isArray(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
246
- Guard_1.Guard.isTrue(Array.isArray(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
247
- Guard_1.Guard.isTrue(Array.isArray(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
243
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
244
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
245
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
246
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
247
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
248
248
  this.validateIndex(startIndex, "Start index is out of range");
249
249
  Guard_1.Guard.arraysSameLengthArr([
250
250
  { arg: xValues, name: "xValues" },
@@ -98,8 +98,8 @@ var XyDataSeries = /** @class */ (function (_super) {
98
98
  */
99
99
  XyDataSeries.prototype.appendRange = function (xValues, yValues, metadata) {
100
100
  if (!this.getIsDeleted()) {
101
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
102
- Guard_1.Guard.isTrue(Array.isArray(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
101
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
102
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
103
103
  Guard_1.Guard.arraysSameLength(xValues, "xValues", yValues, "yValues");
104
104
  if (metadata) {
105
105
  Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
@@ -184,8 +184,8 @@ var XyDataSeries = /** @class */ (function (_super) {
184
184
  */
185
185
  XyDataSeries.prototype.insertRange = function (startIndex, xValues, yValues, metadata) {
186
186
  if (!this.getIsDeleted()) {
187
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
188
- Guard_1.Guard.isTrue(Array.isArray(yValues) || (0, NumberArray_1.isTypedArray)(xValues), "yValues must be an array of numbers");
187
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
188
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
189
189
  this.validateIndex(startIndex, "Start index is out of range");
190
190
  Guard_1.Guard.arraysSameLength(xValues, "xValues", yValues, "yValues");
191
191
  if (metadata) {
@@ -99,9 +99,9 @@ var XyyDataSeries = /** @class */ (function (_super) {
99
99
  */
100
100
  XyyDataSeries.prototype.appendRange = function (xValues, yValues, y1Values, metadata) {
101
101
  if (!this.getIsDeleted()) {
102
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
103
- Guard_1.Guard.isTrue(Array.isArray(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
104
- Guard_1.Guard.isTrue(Array.isArray(y1Values) || (0, NumberArray_1.isTypedArray)(y1Values), "y1Values must be an array of numbers");
102
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
103
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
104
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(y1Values) || (0, NumberArray_1.isTypedArray)(y1Values), "y1Values must be an array of numbers");
105
105
  Guard_1.Guard.arraysSameLengthArr([
106
106
  { arg: xValues, name: "xValues" },
107
107
  { arg: yValues, name: "yValues" },
@@ -201,9 +201,9 @@ var XyyDataSeries = /** @class */ (function (_super) {
201
201
  */
202
202
  XyyDataSeries.prototype.insertRange = function (startIndex, xValues, yValues, y1Values, metadata) {
203
203
  if (!this.getIsDeleted()) {
204
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
205
- Guard_1.Guard.isTrue(Array.isArray(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
206
- Guard_1.Guard.isTrue(Array.isArray(y1Values) || (0, NumberArray_1.isTypedArray)(y1Values), "y1Values must be an array of numbers");
204
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
205
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
206
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(y1Values) || (0, NumberArray_1.isTypedArray)(y1Values), "y1Values must be an array of numbers");
207
207
  this.validateIndex(startIndex, "Start index is out of range");
208
208
  Guard_1.Guard.arraysSameLengthArr([
209
209
  { arg: xValues, name: "xValues" },
@@ -98,9 +98,9 @@ var XyzDataSeries = /** @class */ (function (_super) {
98
98
  */
99
99
  XyzDataSeries.prototype.appendRange = function (xValues, yValues, zValues, metadata) {
100
100
  if (!this.getIsDeleted()) {
101
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
102
- Guard_1.Guard.isTrue(Array.isArray(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
103
- Guard_1.Guard.isTrue(Array.isArray(zValues) || (0, NumberArray_1.isTypedArray)(zValues), "zValues must be an array of numbers");
101
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
102
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
103
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(zValues) || (0, NumberArray_1.isTypedArray)(zValues), "zValues must be an array of numbers");
104
104
  Guard_1.Guard.arraysSameLengthArr([
105
105
  { arg: xValues, name: "xValues" },
106
106
  { arg: yValues, name: "yValues" },
@@ -193,9 +193,9 @@ var XyzDataSeries = /** @class */ (function (_super) {
193
193
  */
194
194
  XyzDataSeries.prototype.insertRange = function (startIndex, xValues, yValues, zValues, metadata) {
195
195
  if (!this.getIsDeleted()) {
196
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
197
- Guard_1.Guard.isTrue(Array.isArray(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
198
- Guard_1.Guard.isTrue(Array.isArray(zValues) || (0, NumberArray_1.isTypedArray)(zValues), "zValues must be an array of numbers");
196
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
197
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
198
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(zValues) || (0, NumberArray_1.isTypedArray)(zValues), "zValues must be an array of numbers");
199
199
  this.validateIndex(startIndex, "Start index is out of range");
200
200
  Guard_1.Guard.arraysSameLengthArr([
201
201
  { arg: xValues, name: "xValues" },
@@ -227,7 +227,7 @@ export declare abstract class AnnotationBase implements IAnnotation, IAdornerPro
227
227
  private opacityProperty;
228
228
  private annotationLayerProperty;
229
229
  private isEditableProperty;
230
- private isHiddenProperty;
230
+ protected isHiddenProperty: boolean;
231
231
  private parentSurfaceProperty;
232
232
  private x1Property;
233
233
  private x2Property;
@@ -26,7 +26,7 @@ var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
26
26
  /** @inheritDoc */
27
27
  _this.type = IAnnotation_1.EAnnotationType.SVG;
28
28
  _this.tooltipProps = renderableSeriesProps;
29
- _this.isHidden = true;
29
+ _this.isHiddenProperty = true;
30
30
  _this.x1 = 0;
31
31
  _this.y1 = 0;
32
32
  _this.xCoordShift = -4;
@@ -38,6 +38,11 @@ var SvgAnnotationBase = /** @class */ (function (_super) {
38
38
  var _this = _super.call(this, options) || this;
39
39
  /** @inheritDoc */
40
40
  _this.isSvgAnnotation = true;
41
+ /**
42
+ * The {@link SVGElement} which will be added to the chart
43
+ */
44
+ _this.xCoordShiftProperty = 0;
45
+ _this.yCoordShiftProperty = 0;
41
46
  _this.verticalAnchorPointProperty = AnchorPoint_1.EVerticalAnchorPoint.Top;
42
47
  _this.horizontalAnchorPointProperty = AnchorPoint_1.EHorizontalAnchorPoint.Left;
43
48
  _this.prevX1Coordinate = 0;
@@ -292,8 +297,8 @@ var SvgAnnotationBase = /** @class */ (function (_super) {
292
297
  SvgAnnotationBase.prototype.calcAndSetAnnotationBorders = function (xCalc, yCalc) {
293
298
  if (!this.svg)
294
299
  return;
295
- var borderX1 = this.getX1Coordinate(xCalc, yCalc);
296
- var borderY1 = this.getY1Coordinate(xCalc, yCalc);
300
+ var borderX1 = this.getX1Coordinate(xCalc, yCalc) + this.xCoordShift;
301
+ var borderY1 = this.getY1Coordinate(xCalc, yCalc) + this.yCoordShift;
297
302
  this.svgDOMRect = this.svg.getBoundingClientRect();
298
303
  var borderX2 = borderX1 + this.svgDOMRect.width;
299
304
  var borderY2 = borderY1 + this.svgDOMRect.height;
@@ -7,6 +7,7 @@ import { EAxisAlignment } from "../../../types/AxisAlignment";
7
7
  import { EAxisType } from "../../../types/AxisType";
8
8
  import { TBorder } from "../../../types/TBorder";
9
9
  import { SCRTPen, SCRTSolidBrush, TSciChart } from "../../../types/TSciChart";
10
+ import { TStackedAxisLength } from "../../../types/TStackedAxisLength";
10
11
  import { WebGlRenderContext2D } from "../../Drawing/WebGlRenderContext2D";
11
12
  import { IThemeable } from "../../Themes/IThemeable";
12
13
  import { IThemeProvider } from "../../Themes/IThemeProvider";
@@ -112,6 +113,13 @@ export interface IAxisBase2dOptions extends IAxisCoreOptions {
112
113
  * @remarks Center axis uses inner layout strategy
113
114
  */
114
115
  isInnerAxis?: boolean;
116
+ /** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
117
+ * A plain number will be interpreted as a number of pixels.
118
+ * A number with % will take that percentage of the total length.
119
+ * Stacked axes without a defined length will have the remaining unreserved spaced split between them.
120
+ * @remarks The axis length doesn't include border sizes
121
+ */
122
+ stackedAxisLength?: TStackedAxisLength;
115
123
  /**
116
124
  * Sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
117
125
  */
@@ -230,6 +238,20 @@ export declare abstract class AxisBase2D extends AxisCore implements IThemeable
230
238
  * This is only used to allow multiple primary axes, so that all stacked axes can draw gridlines
231
239
  */
232
240
  set isStackedAxis(value: boolean);
241
+ /** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
242
+ * A plain number will be interpreted as a number of pixels.
243
+ * A number with % will take that percentage of the total length.
244
+ * Stacked axes without a defined length will have the remaining unreserved spaced split between them.
245
+ * @remarks The axis length doesn't include border sizes
246
+ */
247
+ get stackedAxisLength(): TStackedAxisLength;
248
+ /** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
249
+ * A plain number will be interpreted as a number of pixels.
250
+ * A number with % will take that percentage of the total length.
251
+ * Stacked axes without a defined length will have the remaining unreserved spaced split between them.
252
+ * @remarks The axis length doesn't include border sizes
253
+ */
254
+ set stackedAxisLength(value: TStackedAxisLength);
233
255
  /**
234
256
  * Called internally - Gets or sets the length the current Axis. E.g. width of horizontal axis or height of vertical axis.
235
257
  */
@@ -308,6 +330,7 @@ export declare abstract class AxisBase2D extends AxisCore implements IThemeable
308
330
  private zoomExtentsRangeProperty;
309
331
  private isPrimaryAxisProperty;
310
332
  private isStackedAxisProperty;
333
+ private stackedAxisLengthProperty;
311
334
  private penCacheForMajorGridLines;
312
335
  private penCacheForMinorGridLines;
313
336
  private penCacheForMajorTickLines;