@progress/kendo-charts 2.8.1-develop.6 → 2.8.1-develop.7

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.
@@ -7,7 +7,7 @@ import NoteMixin from '../mixins/note-mixin';
7
7
 
8
8
  import { LINE_MARKER_SIZE, FADEIN, INITIAL_ANIMATION_DURATION, TOOLTIP_OFFSET, ABOVE, BELOW, CHART_POINT_ROLE, CHART_POINT_CLASSNAME, CHART_POINT_ROLE_DESCRIPTION } from '../constants';
9
9
  import { WHITE, CIRCLE, HIGHLIGHT_ZINDEX, LEFT, RIGHT, BOTTOM, CENTER } from '../../common/constants';
10
- import { deepExtend, valueOrDefault, getSpacing } from '../../common';
10
+ import { deepExtend, valueOrDefault, getSpacing, getTemplate, getAriaTemplate } from '../../common';
11
11
  import guid from '../../core/utils/guid';
12
12
 
13
13
  const AUTO = 'auto';
@@ -206,6 +206,40 @@ class RangeAreaPoint extends ChartElement {
206
206
  getIndex() {
207
207
  return this.categoryIx;
208
208
  }
209
+
210
+ getLabelText(options) {
211
+ let labelTemplate = getTemplate(options);
212
+
213
+ if (labelTemplate) {
214
+ return labelTemplate(this.pointData());
215
+ } else if (options.format) {
216
+ return this.formatValue(options.format);
217
+ }
218
+
219
+ return this.value;
220
+ }
221
+
222
+ getAriaLabelText() {
223
+ const labels = this.options.labels;
224
+ const ariaTemplate = getAriaTemplate(labels);
225
+
226
+ if (ariaTemplate) {
227
+ return ariaTemplate(this.pointData());
228
+ }
229
+
230
+ return this.getLabelText(labels);
231
+ }
232
+
233
+ pointData() {
234
+ return {
235
+ dataItem: this.dataItem,
236
+ category: this.category,
237
+ value: this.value,
238
+ percentage: this.percentage,
239
+ stackValue: this.stackValue,
240
+ series: this.series
241
+ };
242
+ }
209
243
  }
210
244
 
211
245
  deepExtend(RangeAreaPoint.prototype, PointEventsMixin);
@@ -7,7 +7,7 @@ import NoteMixin from '../mixins/note-mixin';
7
7
 
8
8
  import { LINE_MARKER_SIZE, FADEIN, INITIAL_ANIMATION_DURATION, TOOLTIP_OFFSET, ABOVE, BELOW, CHART_POINT_ROLE, CHART_POINT_CLASSNAME, CHART_POINT_ROLE_DESCRIPTION } from '../constants';
9
9
  import { WHITE, CIRCLE, HIGHLIGHT_ZINDEX, LEFT, RIGHT, BOTTOM, CENTER } from '../../common/constants';
10
- import { deepExtend, valueOrDefault, getSpacing } from '../../common';
10
+ import { deepExtend, valueOrDefault, getSpacing, getTemplate, getAriaTemplate } from '../../common';
11
11
  import guid from '../../core/utils/guid';
12
12
 
13
13
  const AUTO = 'auto';
@@ -206,6 +206,40 @@ class RangeAreaPoint extends ChartElement {
206
206
  getIndex() {
207
207
  return this.categoryIx;
208
208
  }
209
+
210
+ getLabelText(options) {
211
+ let labelTemplate = getTemplate(options);
212
+
213
+ if (labelTemplate) {
214
+ return labelTemplate(this.pointData());
215
+ } else if (options.format) {
216
+ return this.formatValue(options.format);
217
+ }
218
+
219
+ return this.value;
220
+ }
221
+
222
+ getAriaLabelText() {
223
+ const labels = this.options.labels;
224
+ const ariaTemplate = getAriaTemplate(labels);
225
+
226
+ if (ariaTemplate) {
227
+ return ariaTemplate(this.pointData());
228
+ }
229
+
230
+ return this.getLabelText(labels);
231
+ }
232
+
233
+ pointData() {
234
+ return {
235
+ dataItem: this.dataItem,
236
+ category: this.category,
237
+ value: this.value,
238
+ percentage: this.percentage,
239
+ stackValue: this.stackValue,
240
+ series: this.series
241
+ };
242
+ }
209
243
  }
210
244
 
211
245
  deepExtend(RangeAreaPoint.prototype, PointEventsMixin);