scichart 3.0.0-beta.235 → 3.0.0-beta.263

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 (41) hide show
  1. package/Builder/buildAnnotations.d.ts +4 -0
  2. package/Builder/buildAnnotations.js +2 -0
  3. package/Charting/Drawing/WebGlRenderContext2D.js +1 -1
  4. package/Charting/Visuals/Annotations/NativeTextAnnotation.d.ts +21 -0
  5. package/Charting/Visuals/Annotations/NativeTextAnnotation.js +45 -4
  6. package/Charting/Visuals/Annotations/constants.d.ts +3 -1
  7. package/Charting/Visuals/Annotations/constants.js +2 -0
  8. package/Charting/Visuals/Axis/AxisBase2D.js +4 -3
  9. package/Charting/Visuals/Axis/AxisRenderer.js +3 -3
  10. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.d.ts +15 -0
  11. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +29 -4
  12. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +4 -2
  13. package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.d.ts +0 -13
  14. package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.js +1 -21
  15. package/Charting/Visuals/RenderableSeries/DataLabels/BubbleSeriesDataLabelProvider.js +1 -1
  16. package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.d.ts +4 -4
  17. package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.js +88 -38
  18. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +4 -3
  19. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.d.ts +2 -0
  20. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.js +10 -0
  21. package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.d.ts +5 -2
  22. package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.js +12 -5
  23. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -13
  24. package/Charting/Visuals/SciChartSurface.d.ts +7 -0
  25. package/Charting/Visuals/SciChartSurface.js +68 -16
  26. package/Charting/Visuals/createMaster.js +2 -1
  27. package/Core/BuildStamp.d.ts +1 -1
  28. package/Core/BuildStamp.js +2 -2
  29. package/Core/Mouse/MouseManager.js +1 -1
  30. package/_wasm/scichart.browser.js +1 -1
  31. package/_wasm/scichart2d.js +20 -20
  32. package/_wasm/scichart2d.wasm +0 -0
  33. package/_wasm/scichart3d.js +32 -32
  34. package/_wasm/scichart3d.wasm +0 -0
  35. package/package.json +1 -1
  36. package/types/TSciChart.d.ts +13 -0
  37. package/types/TSciChart3D.d.ts +11 -0
  38. package/types/TextPosition.d.ts +2 -2
  39. package/types/TextPosition.js +2 -2
  40. package/utils/pointUtil.d.ts +1 -1
  41. package/utils/pointUtil.js +2 -2
@@ -3,6 +3,7 @@ import { IBoxAnnotationOptions } from "../Charting/Visuals/Annotations/BoxAnnota
3
3
  import { ICustomAnnotationOptions } from "../Charting/Visuals/Annotations/CustomAnnotation";
4
4
  import { EAnnotationType } from "../Charting/Visuals/Annotations/IAnnotation";
5
5
  import { ILineAnnotationOptions } from "../Charting/Visuals/Annotations/LineAnnotation";
6
+ import { INativeTextAnnotationOptions } from "../Charting/Visuals/Annotations/NativeTextAnnotation";
6
7
  import { ITextAnnotationOptions } from "../Charting/Visuals/Annotations/TextAnnotation";
7
8
  /** Definition of an annotation, comprising a {@link EAnnotationType} and the relevant options */
8
9
  export declare type TAnnotationDefinition = {
@@ -26,6 +27,9 @@ export declare type TAnnotationDefinition = {
26
27
  } | {
27
28
  type: EAnnotationType.SVGCustomAnnotation;
28
29
  options?: ICustomAnnotationOptions;
30
+ } | {
31
+ type: EAnnotationType.RenderContextNativeTextAnnotation;
32
+ options?: INativeTextAnnotationOptions;
29
33
  };
30
34
  /**
31
35
  * Build one or more annotations from a definition that can be pure data.
@@ -7,6 +7,7 @@ var CustomAnnotation_1 = require("../Charting/Visuals/Annotations/CustomAnnotati
7
7
  var HorizontalLineAnnotation_1 = require("../Charting/Visuals/Annotations/HorizontalLineAnnotation");
8
8
  var IAnnotation_1 = require("../Charting/Visuals/Annotations/IAnnotation");
9
9
  var LineAnnotation_1 = require("../Charting/Visuals/Annotations/LineAnnotation");
10
+ var NativeTextAnnotation_1 = require("../Charting/Visuals/Annotations/NativeTextAnnotation");
10
11
  var TextAnnotation_1 = require("../Charting/Visuals/Annotations/TextAnnotation");
11
12
  var VerticalLineAnnotation_1 = require("../Charting/Visuals/Annotations/VerticalLineAnnotation");
12
13
  var BaseType_1 = require("../types/BaseType");
@@ -20,6 +21,7 @@ var classFactory_1 = require("./classFactory");
20
21
  (0, classFactory_1.registerType)(BaseType_1.EBaseType.Annotation, IAnnotation_1.EAnnotationType.RenderContextVerticalLineAnnotation, function (options) { return new VerticalLineAnnotation_1.VerticalLineAnnotation(options); }, true);
21
22
  (0, classFactory_1.registerType)(BaseType_1.EBaseType.Annotation, IAnnotation_1.EAnnotationType.SVGTextAnnotation, function (options) { return new TextAnnotation_1.TextAnnotation(options); }, true);
22
23
  (0, classFactory_1.registerType)(BaseType_1.EBaseType.Annotation, IAnnotation_1.EAnnotationType.SVGCustomAnnotation, function (options) { return new CustomAnnotation_1.CustomAnnotation(options); }, true);
24
+ (0, classFactory_1.registerType)(BaseType_1.EBaseType.Annotation, IAnnotation_1.EAnnotationType.RenderContextNativeTextAnnotation, function (options) { return new NativeTextAnnotation_1.NativeTextAnnotation(options); }, true);
23
25
  /**
24
26
  * Build one or more annotations from a definition that can be pure data.
25
27
  * @param definition One or an array of {@link TAnnotationDefinition}
@@ -312,7 +312,7 @@ var WebGlRenderContext2D = /** @class */ (function () {
312
312
  this.webAssemblyContext.TSRRequestCanvasDraw((_a = this.canvasId) !== null && _a !== void 0 ? _a : "undefinedCanvasId");
313
313
  }
314
314
  else if (currentFontName !== fontKey.m_strName) {
315
- console.warn("Font ".concat(fontKey.m_strName, ".ttf could not be found on the server. Falling back to Arial"));
315
+ console.warn("Font ".concat(fontKey.m_strName, " could not be found on the server. Falling back to Arial"));
316
316
  }
317
317
  return nativeFont;
318
318
  };
@@ -56,6 +56,13 @@ export interface INativeTextAnnotationOptions extends IAnnotationBaseOptions {
56
56
  * If a whole number then treated as pixels. If between 0 and 1 then treated as a fraction of line height
57
57
  */
58
58
  lineSpacing?: number;
59
+ /**
60
+ * The scale factor for the font. Default 1
61
+ * This changes the size of the text without needing to create a new font with a different size
62
+ */
63
+ scale?: number;
64
+ /** Set true to make the font scale when the annotation is resized. Must set x2 as well. Cannot be used with wrapTo */
65
+ scaleOnResize?: boolean;
59
66
  }
60
67
  /**
61
68
  * @summary The {@link NativeTextAnnotation} provides an {@link AnnotationBase | Annotation} which draws a text at
@@ -72,6 +79,8 @@ export interface INativeTextAnnotationOptions extends IAnnotationBaseOptions {
72
79
  export declare class NativeTextAnnotation extends RenderContextAnnotationBase {
73
80
  /** @inheritDoc */
74
81
  readonly type: EAnnotationType;
82
+ /** Set true to make the font scale when the annotation is resized. Must set x2 as well. Cannot be used with wrapTo */
83
+ scaleOnResize: boolean;
75
84
  protected fontSizeProperty?: number;
76
85
  protected fontFamilyProperty?: string;
77
86
  protected textColorProperty: string;
@@ -82,6 +91,8 @@ export declare class NativeTextAnnotation extends RenderContextAnnotationBase {
82
91
  protected multiLineAlignmentProperty?: EMultiLineAlignment;
83
92
  protected wrapToProperty?: number | EWrapTo;
84
93
  protected lineSpacingProperty?: number;
94
+ protected scaleProperty?: number;
95
+ private initialWidth;
85
96
  /**
86
97
  * Create an instance of a NativeTextAnnotation
87
98
  * @param options Optional parameters of type {@link INativeTextAnnotationOptions} which configure the annotation upon construction
@@ -169,6 +180,16 @@ export declare class NativeTextAnnotation extends RenderContextAnnotationBase {
169
180
  * If a whole number then treated as pixels. If between 0 and 1 then treated as a fraction of line height
170
181
  */
171
182
  set lineSpacing(value: number);
183
+ /**
184
+ * The scale factor for the font. Default 1
185
+ * This changes the size of the text without needing to create a new font with a different size
186
+ */
187
+ get scale(): number;
188
+ /**
189
+ * The scale factor for the font. Default 1
190
+ * This changes the size of the text without needing to create a new font with a different size
191
+ */
192
+ set scale(value: number);
172
193
  /** @inheritDoc */
173
194
  delete(): void;
174
195
  /** @inheritDoc */
@@ -58,10 +58,12 @@ var NativeTextAnnotation = /** @class */ (function (_super) {
58
58
  */
59
59
  function NativeTextAnnotation(options) {
60
60
  var _this = this;
61
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
61
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
62
62
  _this = _super.call(this, options) || this;
63
63
  /** @inheritDoc */
64
64
  _this.type = IAnnotation_1.EAnnotationType.RenderContextNativeTextAnnotation;
65
+ /** Set true to make the font scale when the annotation is resized. Must set x2 as well. Cannot be used with wrapTo */
66
+ _this.scaleOnResize = false;
65
67
  _this.fontSizeProperty = 14;
66
68
  _this.fontFamilyProperty = "Arial";
67
69
  _this.textColorProperty = "#ffffff";
@@ -71,6 +73,7 @@ var NativeTextAnnotation = /** @class */ (function (_super) {
71
73
  _this.horizontalAnchorPointProperty = AnchorPoint_1.EHorizontalAnchorPoint.Left;
72
74
  _this.multiLineAlignmentProperty = TextPosition_1.EMultiLineAlignment.Center;
73
75
  _this.lineSpacingProperty = 3;
76
+ _this.scaleProperty = 1;
74
77
  _this.svgStringAdornerTemplate = function (x1, y1, x2, y2) {
75
78
  var colorLine = _this.selectionBoxStroke;
76
79
  var width = x2 - x1;
@@ -102,6 +105,9 @@ var NativeTextAnnotation = /** @class */ (function (_super) {
102
105
  _this.multiLineAlignmentProperty = (_h = options === null || options === void 0 ? void 0 : options.multiLineAlignment) !== null && _h !== void 0 ? _h : _this.multiLineAlignmentProperty;
103
106
  _this.wrapToProperty = (_j = options === null || options === void 0 ? void 0 : options.wrapTo) !== null && _j !== void 0 ? _j : _this.wrapToProperty;
104
107
  _this.lineSpacingProperty = (_k = options === null || options === void 0 ? void 0 : options.lineSpacing) !== null && _k !== void 0 ? _k : _this.lineSpacingProperty;
108
+ _this.scaleProperty = (_l = options === null || options === void 0 ? void 0 : options.scale) !== null && _l !== void 0 ? _l : _this.scaleProperty;
109
+ _this.initialWidth = Math.abs(_this.x2 - _this.x1);
110
+ _this.scaleOnResize = (_m = options === null || options === void 0 ? void 0 : options.scaleOnResize) !== null && _m !== void 0 ? _m : _this.scaleOnResize;
105
111
  return _this;
106
112
  }
107
113
  Object.defineProperty(NativeTextAnnotation.prototype, "textColor", {
@@ -284,6 +290,27 @@ var NativeTextAnnotation = /** @class */ (function (_super) {
284
290
  enumerable: false,
285
291
  configurable: true
286
292
  });
293
+ Object.defineProperty(NativeTextAnnotation.prototype, "scale", {
294
+ /**
295
+ * The scale factor for the font. Default 1
296
+ * This changes the size of the text without needing to create a new font with a different size
297
+ */
298
+ get: function () {
299
+ return this.scaleProperty;
300
+ },
301
+ /**
302
+ * The scale factor for the font. Default 1
303
+ * This changes the size of the text without needing to create a new font with a different size
304
+ */
305
+ set: function (value) {
306
+ if (value !== this.scaleProperty) {
307
+ this.scaleProperty = value;
308
+ this.notifyPropertyChanged(constants_1.PROPERTY.SCALE);
309
+ }
310
+ },
311
+ enumerable: false,
312
+ configurable: true
313
+ });
287
314
  /** @inheritDoc */
288
315
  NativeTextAnnotation.prototype.delete = function () { };
289
316
  /** @inheritDoc */
@@ -310,7 +337,8 @@ var NativeTextAnnotation = /** @class */ (function (_super) {
310
337
  var font;
311
338
  var rotationVector;
312
339
  var rotationRads = -(this.rotation * Math.PI) / 180;
313
- font = renderContext.getFont(style, this.rotation !== 0, false);
340
+ var isAdvanced = this.rotation !== 0 || this.scale !== 1;
341
+ font = renderContext.getFont(style, isAdvanced, false);
314
342
  var textBounds = (0, NativeObject_1.getTextBounds)(this.parentSurface.webAssemblyContext2D);
315
343
  var text = this.text;
316
344
  if (this.wrapTo) {
@@ -392,16 +420,25 @@ var NativeTextAnnotation = /** @class */ (function (_super) {
392
420
  borderY1 = Math.min(x1y1.y, x2y1.y, x1y2.y, x2y2.y) + rc_1.y;
393
421
  borderY2 = Math.max(x1y1.y, x2y1.y, x1y2.y, x2y2.y) + rc_1.y;
394
422
  }
395
- this.setAnnotationBorders(borderX1, borderX2, borderY1, borderY2);
396
423
  var alignMode = (0, TextPosition_1.convertMultiLineAlignment)(this.multiLineAlignment, this.parentSurface.webAssemblyContext2D);
424
+ var oldScale = font.GetScale();
425
+ var scaleChanged = false;
426
+ if (oldScale !== this.scale) {
427
+ font.SetScale(this.scale);
428
+ scaleChanged = true;
429
+ }
430
+ this.setAnnotationBorders(borderX1, borderX1 + (borderX2 - borderX1) * this.scale, borderY1, borderY1 + (borderY2 - borderY1) * this.scale);
397
431
  font.DrawStringAdvanced(text, colorNum, Math.round(x), Math.round(y), rotationVector, alignMode, spacing);
432
+ if (scaleChanged) {
433
+ font.SetScale(oldScale);
434
+ }
398
435
  this.updateAdornerInner();
399
436
  };
400
437
  NativeTextAnnotation.prototype.onDragStarted = function (args) {
401
438
  _super.prototype.onDragStarted.call(this, args);
402
439
  var _a = this.getAnnotationBorders(false, true), x1 = _a.x1, x2 = _a.x2, y1 = _a.y1, y2 = _a.y2;
403
440
  var _b = annotationHelpers_1.annotationHelpers.calcNewApex(x1, y1, x2, y2, this.isVerticalChart), x1y1 = _b.x1y1, x2y1 = _b.x2y1, x1y2 = _b.x1y2, x2y2 = _b.x2y2;
404
- var xyMousePoint = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(args.mousePoint.x, args.mousePoint.y), this.parentSurface.seriesViewRect);
441
+ var xyMousePoint = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(args.mousePoint.x, args.mousePoint.y), this.parentSurface.seriesViewRect, true);
405
442
  if (x1y1 && this.canDragPoint(AnnotationBase_1.EDraggingGripPoint.x1y1)) {
406
443
  var dist = (0, pointUtil_1.calcDistance)(x1y1.x, x1y1.y, xyMousePoint.x, xyMousePoint.y);
407
444
  if (dist < this.annotationsGripsRadius * DpiHelper_1.DpiHelper.PIXEL_RATIO) {
@@ -497,6 +534,10 @@ var NativeTextAnnotation = /** @class */ (function (_super) {
497
534
  this.y2 -= this.prevValue.y - xyValues.y;
498
535
  }
499
536
  }
537
+ var newScale = Math.abs(this.x2 - this.x1) / this.initialWidth;
538
+ if (this.scaleOnResize && newScale) {
539
+ this.scale = newScale;
540
+ }
500
541
  this.prevValue = xyValues;
501
542
  };
502
543
  /**
@@ -64,7 +64,9 @@ export declare enum PROPERTY {
64
64
  DRAGPOINTS = "DRAGPOINTS",
65
65
  MULTILINE_ALIGNMENT = "MULTILINE_ALIGNMENT",
66
66
  WRAP_TO = "WRAP_TO",
67
- LINE_SPACING = "LINE_SPACING"
67
+ LINE_SPACING = "LINE_SPACING",
68
+ SCALE = "SCALE",
69
+ OUTLINE = "OUTLINE"
68
70
  }
69
71
  export declare const ADORNER_GRIP_RADIUS = 10;
70
72
  export declare const DISTANCE_TO_LINE = 10;
@@ -69,6 +69,8 @@ var PROPERTY;
69
69
  PROPERTY["MULTILINE_ALIGNMENT"] = "MULTILINE_ALIGNMENT";
70
70
  PROPERTY["WRAP_TO"] = "WRAP_TO";
71
71
  PROPERTY["LINE_SPACING"] = "LINE_SPACING";
72
+ PROPERTY["SCALE"] = "SCALE";
73
+ PROPERTY["OUTLINE"] = "OUTLINE";
72
74
  })(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
73
75
  exports.ADORNER_GRIP_RADIUS = 10;
74
76
  exports.DISTANCE_TO_LINE = 10;
@@ -1147,6 +1147,7 @@ var AxisBase2D = /** @class */ (function (_super) {
1147
1147
  return Math.round(index);
1148
1148
  };
1149
1149
  AxisBase2D.prototype.getTicks = function (regenerate) {
1150
+ var _a, _b;
1150
1151
  if (regenerate || !this.tickCache) {
1151
1152
  var maxAutoTicks = this.getMaxAutoTicks();
1152
1153
  if (this.autoTicks) {
@@ -1155,12 +1156,12 @@ var AxisBase2D = /** @class */ (function (_super) {
1155
1156
  this.majorDeltaProperty = delta.max;
1156
1157
  }
1157
1158
  var majorTicks = this.drawLabels || this.drawMajorGridLines || this.drawMajorTickLines
1158
- ? this.tickProvider.getMajorTicks(this.minorDeltaProperty, this.majorDeltaProperty, this.visibleRange)
1159
+ ? this.tickProvider.getMajorTicks((_a = this.minorDeltaProperty) !== null && _a !== void 0 ? _a : this.majorDeltaProperty / this.minorsPerMajor, this.majorDeltaProperty, this.visibleRange)
1159
1160
  : [];
1160
1161
  var minorTicks = this.drawMinorGridLines || this.drawMinorTickLines
1161
- ? this.tickProvider.getMinorTicks(this.minorDeltaProperty, this.majorDeltaProperty, this.visibleRange)
1162
+ ? this.tickProvider.getMinorTicks((_b = this.minorDeltaProperty) !== null && _b !== void 0 ? _b : this.majorDeltaProperty / this.minorsPerMajor, this.majorDeltaProperty, this.visibleRange)
1162
1163
  : [];
1163
- var _a = this.visibleRange, min_1 = _a.min, max_1 = _a.max;
1164
+ var _c = this.visibleRange, min_1 = _c.min, max_1 = _c.max;
1164
1165
  majorTicks = majorTicks.filter(function (t) { return t >= min_1 && t <= max_1; });
1165
1166
  minorTicks = minorTicks.filter(function (t) { return t >= min_1 && t <= max_1; });
1166
1167
  var majorTickLabels = [];
@@ -222,6 +222,7 @@ var AxisRenderer = /** @class */ (function () {
222
222
  var rotationRad = -(adjRotation * Math.PI) / 180;
223
223
  tickCoords = tickCoords.map(function (t) { return t - axisOffset; });
224
224
  var multiLineAlignment = convertMultiLineAlignment(alignment, this.webAssemblyContext);
225
+ var nativeLineSpacing = labelProvider.lineSpacing;
225
226
  var lineHeight = 0;
226
227
  if (nativeFont) {
227
228
  nativeFont.CalculateStringBounds("Ag", textBounds, 0);
@@ -277,8 +278,7 @@ var AxisRenderer = /** @class */ (function () {
277
278
  tx -= textWidth;
278
279
  }
279
280
  }
280
- nativeFont.DrawStringAdvanced(labelText !== null && labelText !== void 0 ? labelText : "", textColor, Math.round(tx), Math.round(ty), (0, NativeObject_1.getVector4)(this.webAssemblyContext, rx, ry, rotationRad, 0), multiLineAlignment, 2 // TODO from labelProvider
281
- );
281
+ nativeFont.DrawStringAdvanced(labelText !== null && labelText !== void 0 ? labelText : "", textColor, Math.round(tx), Math.round(ty), (0, NativeObject_1.getVector4)(this.webAssemblyContext, rx, ry, rotationRad, 0), multiLineAlignment, nativeLineSpacing);
282
282
  }
283
283
  else {
284
284
  var _d = labelProvider.getCachedLabelTexture(labelText, textureManager, labelStyle), bitmapTexture = _d.bitmapTexture, textureHeight = _d.textureHeight, textureWidth = _d.textureWidth;
@@ -325,7 +325,7 @@ var AxisRenderer = /** @class */ (function () {
325
325
  if (nativeFont) {
326
326
  var tx = xCoord + viewRect.left + padding.left;
327
327
  var ty = yCoord + viewRect.top + lineHeight - padding.bottom;
328
- nativeFont.DrawStringAdvanced(labelText !== null && labelText !== void 0 ? labelText : "", textColor, Math.round(tx), Math.round(ty), (0, NativeObject_1.getVector4)(this.webAssemblyContext, tx, ty, rotationRad, 0), multiLineAlignment, 2);
328
+ nativeFont.DrawStringAdvanced(labelText !== null && labelText !== void 0 ? labelText : "", textColor, Math.round(tx), Math.round(ty), (0, NativeObject_1.getVector4)(this.webAssemblyContext, tx, ty, rotationRad, 0), multiLineAlignment, nativeLineSpacing);
329
329
  }
330
330
  else {
331
331
  var _g = labelProvider.getCachedLabelTexture(labelText, textureManager, labelStyle), bitmapTexture = _g.bitmapTexture, textureHeight = _g.textureHeight, textureWidth = _g.textureWidth;
@@ -35,6 +35,12 @@ export interface ILabel2DOptions extends ILabelOptions {
35
35
  * Experimental - set true to use native text for axes. Not all text features currently supported
36
36
  */
37
37
  useNativeText?: boolean;
38
+ /**
39
+ * Line spacing to use if text is wrapped.
40
+ * For normal labels this is a multiple of the text height and defaults to 1.1
41
+ * For native text it is a number of pixels and defaults to 2
42
+ */
43
+ lineSpacing?: number;
38
44
  }
39
45
  /**
40
46
  * The {@link LabelProviderBase2D} provides base functionality for 2D label providers, including caching of label textures
@@ -66,9 +72,18 @@ export declare abstract class LabelProviderBase2D extends LabelProvider implemen
66
72
  */
67
73
  protected styleId: string;
68
74
  private rotationProperty;
75
+ private lineSpacingProperty;
69
76
  constructor(options?: ILabel2DOptions);
70
77
  get rotation(): number;
71
78
  set rotation(value: number);
79
+ /**
80
+ * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
81
+ */
82
+ get lineSpacing(): number;
83
+ /**
84
+ * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
85
+ */
86
+ set lineSpacing(value: number);
72
87
  /**
73
88
  * Returns an array of label strings for an array of major tick numeric values
74
89
  * @param majorTicks The major tick numeric values
@@ -99,7 +99,7 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
99
99
  __extends(LabelProviderBase2D, _super);
100
100
  function LabelProviderBase2D(options) {
101
101
  var _this = this;
102
- var _a, _b, _c, _d;
102
+ var _a, _b, _c, _d, _e;
103
103
  _this = _super.call(this, options) || this;
104
104
  _this.useCache = !app_1.IS_TEST_ENV;
105
105
  /**
@@ -110,11 +110,13 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
110
110
  /** Set this true if the format function could return different results for the same input (eg SmartDateLabelprovider) */
111
111
  _this.textVariesForSameTick = false;
112
112
  _this.rotationProperty = 0;
113
+ _this.lineSpacingProperty = 1.1;
113
114
  _this.providerId = (0, guid_1.generateGuid)();
114
115
  _this.rotationProperty = (_a = options === null || options === void 0 ? void 0 : options.rotation) !== null && _a !== void 0 ? _a : _this.rotationProperty;
115
- _this.asyncLabels = (_b = options === null || options === void 0 ? void 0 : options.asyncLabels) !== null && _b !== void 0 ? _b : SciChartDefaults_1.SciChartDefaults.asyncLabels;
116
- _this.useSharedCache = (_c = options === null || options === void 0 ? void 0 : options.useSharedCache) !== null && _c !== void 0 ? _c : SciChartDefaults_1.SciChartDefaults.useSharedCache;
117
- _this.useNativeText = (_d = options === null || options === void 0 ? void 0 : options.useNativeText) !== null && _d !== void 0 ? _d : SciChartDefaults_1.SciChartDefaults.useNativeText;
116
+ _this.lineSpacing = (_b = options === null || options === void 0 ? void 0 : options.lineSpacing) !== null && _b !== void 0 ? _b : _this.lineSpacing;
117
+ _this.asyncLabels = (_c = options === null || options === void 0 ? void 0 : options.asyncLabels) !== null && _c !== void 0 ? _c : SciChartDefaults_1.SciChartDefaults.asyncLabels;
118
+ _this.useSharedCache = (_d = options === null || options === void 0 ? void 0 : options.useSharedCache) !== null && _d !== void 0 ? _d : SciChartDefaults_1.SciChartDefaults.useSharedCache;
119
+ _this.useNativeText = (_e = options === null || options === void 0 ? void 0 : options.useNativeText) !== null && _e !== void 0 ? _e : SciChartDefaults_1.SciChartDefaults.useNativeText;
118
120
  return _this;
119
121
  }
120
122
  Object.defineProperty(LabelProviderBase2D.prototype, "rotation", {
@@ -130,6 +132,28 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
130
132
  enumerable: false,
131
133
  configurable: true
132
134
  });
135
+ Object.defineProperty(LabelProviderBase2D.prototype, "lineSpacing", {
136
+ /**
137
+ * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
138
+ */
139
+ get: function () {
140
+ if (this.useNativeText) {
141
+ return this.lineSpacingProperty === 1.1 ? 2 : this.lineSpacingProperty;
142
+ }
143
+ else {
144
+ return this.lineSpacingProperty;
145
+ }
146
+ },
147
+ /**
148
+ * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
149
+ */
150
+ set: function (value) {
151
+ this.lineSpacingProperty = value;
152
+ this.invalidateParent();
153
+ },
154
+ enumerable: false,
155
+ configurable: true
156
+ });
133
157
  /**
134
158
  * Returns an array of label strings for an array of major tick numeric values
135
159
  * @param majorTicks The major tick numeric values
@@ -395,6 +419,7 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
395
419
  var json = _super.prototype.toJSON.call(this);
396
420
  var options = {
397
421
  rotation: this.rotation,
422
+ lineSpacing: this.lineSpacing,
398
423
  asyncLabels: this.asyncLabels,
399
424
  useSharedCache: this.useSharedCache,
400
425
  useNativeText: this.useNativeText
@@ -123,11 +123,13 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
123
123
  Object.defineProperty(SmartDateLabelProvider.prototype, "numericFormat", {
124
124
  /** @inheritDoc */
125
125
  get: function () {
126
- throw new Error("Setting or getting numericFormat is not supported for SmartDateLabelProvider");
126
+ return undefined;
127
+ // SCJS-1206 throwing erros here breaks serialization
128
+ // throw new Error("Setting or getting numericFormat is not supported for SmartDateLabelProvider");
127
129
  },
128
130
  /** @inheritDoc */
129
131
  set: function (value) {
130
- throw new Error("Setting or getting numericFormat is not supported for SmartDateLabelProvider");
132
+ // throw new Error("Setting or getting numericFormat is not supported for SmartDateLabelProvider");
131
133
  },
132
134
  enumerable: false,
133
135
  configurable: true
@@ -16,16 +16,11 @@ export interface ITextLabelOptions extends ILabel2DOptions {
16
16
  * Wrap text longer than this number of characters. Will only wrap whole words.
17
17
  */
18
18
  maxLength?: number;
19
- /**
20
- * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
21
- */
22
- lineSpacing?: number;
23
19
  }
24
20
  export declare class TextLabelProvider extends LabelProviderBase2D {
25
21
  readonly type = ELabelProviderType.Text;
26
22
  private labelsProperty;
27
23
  private maxLengthProperty;
28
- private lineSpacingProperty;
29
24
  constructor(options?: ITextLabelOptions);
30
25
  /**
31
26
  * The label text to use. If not set by options this will be an empty array.
@@ -52,14 +47,6 @@ export declare class TextLabelProvider extends LabelProviderBase2D {
52
47
  */
53
48
  get maxLength(): number;
54
49
  set maxLength(value: number);
55
- /**
56
- * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
57
- */
58
- get lineSpacing(): number;
59
- /**
60
- * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
61
- */
62
- set lineSpacing(value: number);
63
50
  onBeginAxisDraw(): void;
64
51
  getLabelWidth(ctx: CanvasRenderingContext2D, labelText: string, labelStyle?: TTextStyle): number;
65
52
  getLabelTextureAsync(labelText: string, textureManager: TextureManager, labelStyle: TTextStyle): Promise<import("../../TextureManager/TextureManager").TTextureObject>;
@@ -72,14 +72,12 @@ var TextLabelProvider = /** @class */ (function (_super) {
72
72
  __extends(TextLabelProvider, _super);
73
73
  function TextLabelProvider(options) {
74
74
  var _this = this;
75
- var _a, _b, _c;
75
+ var _a, _b;
76
76
  _this = _super.call(this, options) || this;
77
77
  _this.type = LabelProviderType_1.ELabelProviderType.Text;
78
78
  _this.maxLengthProperty = 0;
79
- _this.lineSpacingProperty = 1.1;
80
79
  _this.labelsProperty = (_a = options === null || options === void 0 ? void 0 : options.labels) !== null && _a !== void 0 ? _a : [];
81
80
  _this.maxLength = (_b = options === null || options === void 0 ? void 0 : options.maxLength) !== null && _b !== void 0 ? _b : _this.maxLength;
82
- _this.lineSpacing = (_c = options === null || options === void 0 ? void 0 : options.lineSpacing) !== null && _c !== void 0 ? _c : _this.lineSpacing;
83
81
  _this.formatLabelProperty = function (dataValue) {
84
82
  var _a, _b;
85
83
  if (_this.parentAxis.isCategoryAxis && Array.isArray(_this.labels)) {
@@ -135,23 +133,6 @@ var TextLabelProvider = /** @class */ (function (_super) {
135
133
  enumerable: false,
136
134
  configurable: true
137
135
  });
138
- Object.defineProperty(TextLabelProvider.prototype, "lineSpacing", {
139
- /**
140
- * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
141
- */
142
- get: function () {
143
- return this.lineSpacingProperty;
144
- },
145
- /**
146
- * Line spacing to use if text is wrapped, as a multiple of the text height. Defaults to 1.1
147
- */
148
- set: function (value) {
149
- this.lineSpacingProperty = value;
150
- this.invalidateParent();
151
- },
152
- enumerable: false,
153
- configurable: true
154
- });
155
136
  TextLabelProvider.prototype.onBeginAxisDraw = function () { };
156
137
  TextLabelProvider.prototype.getLabelWidth = function (ctx, labelText, labelStyle) {
157
138
  if (this.useNativeText || this.rotation % 90 === 0 || !this.parentAxis.isHorizontalAxis) {
@@ -208,7 +189,6 @@ var TextLabelProvider = /** @class */ (function (_super) {
208
189
  var json = _super.prototype.toJSON.call(this);
209
190
  var options = {
210
191
  labels: this.labels,
211
- lineSpacing: this.lineSpacing,
212
192
  maxLength: this.maxLength
213
193
  };
214
194
  Object.assign(json.options, options);
@@ -49,7 +49,7 @@ var BubbleSeriesDataLabelProvider = /** @class */ (function (_super) {
49
49
  if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Center) {
50
50
  y += textBounds.m_fHeight / 2;
51
51
  }
52
- else if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Bottom) {
52
+ else if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Below) {
53
53
  y += textBounds.m_fHeight + ((_f = (_e = this.style.padding) === null || _e === void 0 ? void 0 : _e.top) !== null && _f !== void 0 ? _f : 0) + radius;
54
54
  }
55
55
  else {
@@ -8,12 +8,12 @@ import { DataLabelState } from "./DataLabelState";
8
8
  export declare enum EColumnDataLabelPosition {
9
9
  Outside = "Outside",
10
10
  Inside = "Inside",
11
- VerticalPosition = "VerticalPosition"
11
+ Position = "Position"
12
12
  }
13
13
  export interface IColumnSeriesDataLabelProviderOptions extends IDataLabelProviderOptions {
14
14
  /**
15
15
  * Sets whether text should be positioned outside or inside the end of the column using {@link EColumnDataLabelPosition}.
16
- * If VerticalPosition then the {@link verticalPosition} property is used.
16
+ * If Position then the {@link verticalTextPosition} property is used, or {@link horizontalTextPosition} if it is a vertical chart.
17
17
  * Default Outside
18
18
  */
19
19
  positionMode?: EColumnDataLabelPosition;
@@ -25,13 +25,13 @@ export declare class ColumnSeriesDataLabelProvider extends DataLabelProvider {
25
25
  constructor(options?: IColumnSeriesDataLabelProviderOptions);
26
26
  /**
27
27
  * Sets whether text should be positioned outside or inside the end of the column using {@link EColumnDataLabelPosition}.
28
- * If VerticalPosition then the {@link verticalPosition} property is used.
28
+ * If Position then the {@link verticalTextPosition} property is used, or {@link horizontalTextPosition} if it is a vertical chart.
29
29
  * Default Outside
30
30
  */
31
31
  get positionMode(): EColumnDataLabelPosition;
32
32
  /**
33
33
  * Sets whether text should be positioned outside or inside the end of the column using {@link EColumnDataLabelPosition}.
34
- * If VerticalPosition then the {@link verticalPosition} property is used.
34
+ * If Position then the {@link verticalTextPosition} property is used, or {@link horizontalTextPosition} if it is a vertical chart.
35
35
  * Default Outside
36
36
  */
37
37
  set positionMode(value: EColumnDataLabelPosition);