@eclipse-scout/chart 23.2.13 → 24.1.0-beta.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.
- package/dist/d.ts/chart/AbstractSvgChartRenderer.d.ts +6 -0
- package/dist/d.ts/chart/AbstractSvgChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/chart/Chart.d.ts.map +1 -1
- package/dist/d.ts/chart/ChartJsRenderer.d.ts +4 -9
- package/dist/d.ts/chart/ChartJsRenderer.d.ts.map +1 -1
- package/dist/d.ts/chart/FulfillmentChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/chart/SpeedoChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/form/fields/chartfield/ChartField.d.ts +1 -0
- package/dist/d.ts/form/fields/chartfield/ChartField.d.ts.map +1 -1
- package/dist/d.ts/table/controls/ChartTableControl.d.ts +1 -1
- package/dist/d.ts/table/controls/ChartTableControl.d.ts.map +1 -1
- package/dist/eclipse-scout-chart-1a81682e3fb823b0ca01.min.js +3 -0
- package/dist/eclipse-scout-chart-1a81682e3fb823b0ca01.min.js.map +1 -0
- package/dist/eclipse-scout-chart-theme-dark.css +1 -1
- package/dist/eclipse-scout-chart-theme-dark.css.map +1 -1
- package/dist/eclipse-scout-chart-theme.css +1 -1
- package/dist/eclipse-scout-chart-theme.css.map +1 -1
- package/dist/eclipse-scout-chart.esm-063bb266266e01e3ccd0.min.js +3 -0
- package/dist/eclipse-scout-chart.esm-063bb266266e01e3ccd0.min.js.map +1 -0
- package/dist/eclipse-scout-chart.esm.js +144 -116
- package/dist/eclipse-scout-chart.esm.js.map +1 -1
- package/dist/eclipse-scout-chart.js +144 -116
- package/dist/eclipse-scout-chart.js.map +1 -1
- package/dist/file-list +4 -4
- package/dist/texts.json +4 -0
- package/package.json +15 -15
- package/src/chart/AbstractSvgChartRenderer.ts +22 -1
- package/src/chart/Chart.ts +2 -1
- package/src/chart/ChartJsRenderer.ts +26 -26
- package/src/chart/FulfillmentChartRenderer.ts +3 -1
- package/src/chart/SpeedoChartRenderer.ts +2 -1
- package/src/form/fields/chartfield/ChartField.ts +4 -0
- package/src/table/controls/ChartTableControl.ts +22 -20
- package/dist/eclipse-scout-chart-7bef43c691398f0f5930.min.js +0 -3
- package/dist/eclipse-scout-chart-7bef43c691398f0f5930.min.js.map +0 -1
- package/dist/eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js +0 -3
- package/dist/eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js.map +0 -1
package/dist/file-list
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
eclipse-scout-chart-
|
|
2
|
-
eclipse-scout-chart-
|
|
1
|
+
eclipse-scout-chart-1a81682e3fb823b0ca01.min.js
|
|
2
|
+
eclipse-scout-chart-1a81682e3fb823b0ca01.min.js.map
|
|
3
3
|
eclipse-scout-chart-theme-56ba6667e592ef147869.min.css
|
|
4
4
|
eclipse-scout-chart-theme-dark-593955eea95984c5aa62.min.css
|
|
5
5
|
eclipse-scout-chart-theme-dark.css
|
|
6
6
|
eclipse-scout-chart-theme-dark.css.map
|
|
7
7
|
eclipse-scout-chart-theme.css
|
|
8
8
|
eclipse-scout-chart-theme.css.map
|
|
9
|
-
eclipse-scout-chart.esm-
|
|
10
|
-
eclipse-scout-chart.esm-
|
|
9
|
+
eclipse-scout-chart.esm-063bb266266e01e3ccd0.min.js
|
|
10
|
+
eclipse-scout-chart.esm-063bb266266e01e3ccd0.min.js.map
|
|
11
11
|
eclipse-scout-chart.esm.js
|
|
12
12
|
eclipse-scout-chart.esm.js.map
|
|
13
13
|
eclipse-scout-chart.js
|
package/dist/texts.json
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
"ui.Bio": "Tri.",
|
|
4
4
|
"ui.Brd": "quad",
|
|
5
5
|
"ui.Chart": "Chart",
|
|
6
|
+
"ui.FulfillmentChartAriaDescription": "Fulfillment chart. Current value: {0}%",
|
|
6
7
|
"ui.Mio": "Mio.",
|
|
7
8
|
"ui.Mrd": "Bio.",
|
|
9
|
+
"ui.SpeedoChartAriaDescription": "Speedo chart. Current value: {0} Minimum value: {1} Maximum value: {2}",
|
|
8
10
|
"ui.TooMuchData": "Too much data",
|
|
9
11
|
"ui.Trd": "Sex.",
|
|
10
12
|
"ui.Tri": "Qui.",
|
|
@@ -37,8 +39,10 @@
|
|
|
37
39
|
"ui.Bio": "Bio.",
|
|
38
40
|
"ui.Brd": "Brd.",
|
|
39
41
|
"ui.Chart": "Diagramm",
|
|
42
|
+
"ui.FulfillmentChartAriaDescription": "Erfüllungsgrad-Diagramm. Aktueller Wert: {0} %",
|
|
40
43
|
"ui.Mio": "Mio.",
|
|
41
44
|
"ui.Mrd": "Mrd.",
|
|
45
|
+
"ui.SpeedoChartAriaDescription": "Zeigerdiagramm. Aktueller Wert: {0} Minimaler Wert: {1} Maximaler Wert: {2}",
|
|
42
46
|
"ui.TooMuchData": "Zu viele Daten",
|
|
43
47
|
"ui.Trd": "Trd.",
|
|
44
48
|
"ui.Tri": "Tri.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-scout/chart",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.1.0-beta.1",
|
|
4
4
|
"description": "Eclipse Scout chart",
|
|
5
5
|
"author": "BSI Business Systems Integration AG",
|
|
6
6
|
"homepage": "https://www.eclipse.org/scout",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"license": "EPL-2.0",
|
|
12
12
|
"engines": {
|
|
13
|
-
"node": ">=
|
|
14
|
-
"npm": ">=
|
|
15
|
-
"pnpm": ">=
|
|
13
|
+
"node": ">=20.10.0",
|
|
14
|
+
"npm": ">=10.2.3",
|
|
15
|
+
"pnpm": ">=8.11.0"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"scout",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"src"
|
|
27
27
|
],
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@eclipse-scout/cli": "
|
|
30
|
-
"@eclipse-scout/releng": "^
|
|
31
|
-
"jasmine-core": "
|
|
29
|
+
"@eclipse-scout/cli": "24.1.0-beta.1",
|
|
30
|
+
"@eclipse-scout/releng": "^24.1.0",
|
|
31
|
+
"jasmine-core": "5.1.1",
|
|
32
32
|
"jasmine-jquery": "2.1.1",
|
|
33
|
-
"karma": "6.4.
|
|
34
|
-
"@types/jquery": "3.5.
|
|
35
|
-
"@types/jasmine": "
|
|
36
|
-
"@types/jasmine-jquery": "1.5.
|
|
33
|
+
"karma": "6.4.2",
|
|
34
|
+
"@types/jquery": "3.5.29",
|
|
35
|
+
"@types/jasmine": "5.1.4",
|
|
36
|
+
"@types/jasmine-jquery": "1.5.37"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@eclipse-scout/core": "
|
|
40
|
-
"jquery": "3.
|
|
41
|
-
"chart.js": "
|
|
42
|
-
"chartjs-plugin-datalabels": "2.
|
|
39
|
+
"@eclipse-scout/core": "24.1.0-beta.1",
|
|
40
|
+
"jquery": "3.7.1",
|
|
41
|
+
"chart.js": "4.4.0",
|
|
42
|
+
"chartjs-plugin-datalabels": "2.2.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"testserver:start": "scout-scripts test-server:start",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
*/
|
|
10
|
-
import {ObjectFactory, strings, styles} from '@eclipse-scout/core';
|
|
10
|
+
import {aria, ObjectFactory, strings, styles} from '@eclipse-scout/core';
|
|
11
11
|
import $ from 'jquery';
|
|
12
12
|
import {AbstractChartRenderer, Chart} from '../index';
|
|
13
13
|
import {ClickObject} from './Chart';
|
|
@@ -43,6 +43,9 @@ export class AbstractSvgChartRenderer extends AbstractChartRenderer {
|
|
|
43
43
|
protected override _render() {
|
|
44
44
|
if (!this.$svg) {
|
|
45
45
|
this.$svg = this.chart.$container.appendSVG('svg', 'chart-svg');
|
|
46
|
+
aria.role(this.$svg, 'img');
|
|
47
|
+
// labeling has to be done here because otherwise the svg is ignored
|
|
48
|
+
this.linkChartWithFieldLabel(this.$svg);
|
|
46
49
|
}
|
|
47
50
|
this.firstOpaqueBackgroundColor = styles.getFirstOpaqueBackgroundColor(this.$svg);
|
|
48
51
|
// This works, because CSS specifies 100% width/height
|
|
@@ -65,6 +68,24 @@ export class AbstractSvgChartRenderer extends AbstractChartRenderer {
|
|
|
65
68
|
this._renderInternal();
|
|
66
69
|
}
|
|
67
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Links chart svg with its field label so the field name is read when entering the chart
|
|
73
|
+
*
|
|
74
|
+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby">ARIA: aria-labelledby</a>
|
|
75
|
+
*/
|
|
76
|
+
linkChartWithFieldLabel($chartSvg: JQuery<Element>) {
|
|
77
|
+
if (!$chartSvg) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let $field = $chartSvg.parents('.chart-field');
|
|
81
|
+
if ($field.length > 0) {
|
|
82
|
+
let $fieldLabel = $field.eq(0).children('label');
|
|
83
|
+
if ($fieldLabel.length > 0) {
|
|
84
|
+
aria.linkElementWithLabel($chartSvg, $fieldLabel.eq(0));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
68
89
|
protected _renderInternal() {
|
|
69
90
|
// Override in subclasses
|
|
70
91
|
}
|
package/src/chart/Chart.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
*/
|
|
10
10
|
import {AbstractChartRenderer, ChartEventMap, ChartJsRenderer, ChartLayout, ChartModel, FulfillmentChartRenderer, SalesfunnelChartRenderer, SpeedoChartRenderer, VennChartRenderer} from '../index';
|
|
11
|
-
import {arrays, ColorScheme, colorSchemes, EnumObject, HtmlComponent, InitModelOf, objects, Widget} from '@eclipse-scout/core';
|
|
11
|
+
import {aria, arrays, ColorScheme, colorSchemes, EnumObject, HtmlComponent, InitModelOf, objects, Widget} from '@eclipse-scout/core';
|
|
12
12
|
import {GreenAreaPosition} from './SpeedoChartRenderer';
|
|
13
13
|
import {ChartConfiguration, LinearScaleOptions, RadialLinearScaleOptions} from 'chart.js';
|
|
14
14
|
import $ from 'jquery';
|
|
@@ -83,6 +83,7 @@ export class Chart extends Widget implements ChartModel {
|
|
|
83
83
|
|
|
84
84
|
protected override _render() {
|
|
85
85
|
this.$container = this.$parent.appendDiv('chart');
|
|
86
|
+
aria.role(this.$container, 'none'); // ignore this container for screen readers, they care about the chart inside
|
|
86
87
|
|
|
87
88
|
this.htmlComp = HtmlComponent.install(this.$container, this.session);
|
|
88
89
|
this.htmlComp.setLayout(new ChartLayout(this));
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
import {AbstractChartRenderer, Chart, chartJsDateAdapter} from '../index';
|
|
11
11
|
import {
|
|
12
12
|
_adapters as chartJsAdapters, ActiveElement, ArcElement, BarElement, BubbleDataPoint, CartesianScaleOptions, Chart as ChartJs, ChartArea, ChartConfiguration, ChartDataset, ChartEvent, ChartType as ChartJsType, Color, DefaultDataPoint,
|
|
13
|
-
FontSpec, LegendElement, LegendItem, LegendOptions, LinearScaleOptions, PointElement, PointHoverOptions,
|
|
14
|
-
TooltipModel, TooltipOptions
|
|
13
|
+
FontSpec, LegendElement, LegendItem, LegendOptions, LinearScaleOptions, PointElement, PointHoverOptions, RadialLinearScaleOptions, Scale, ScatterDataPoint, TooltipCallbacks, TooltipItem, TooltipLabelStyle, TooltipModel, TooltipOptions
|
|
15
14
|
} from 'chart.js';
|
|
16
15
|
import 'chart.js/auto'; // Import from auto to register charts
|
|
17
|
-
import {arrays, colorSchemes, graphics, numbers, objects, Point, scout, strings, styles, Tooltip, tooltips} from '@eclipse-scout/core';
|
|
16
|
+
import {aria, arrays, colorSchemes, graphics, numbers, objects, Point, scout, strings, styles, Tooltip, tooltips} from '@eclipse-scout/core';
|
|
18
17
|
import ChartDataLabels, {Context} from 'chartjs-plugin-datalabels';
|
|
19
18
|
import $ from 'jquery';
|
|
20
19
|
import {ChartAxis, ChartConfig, ChartData, ChartType, ClickObject, NumberFormatter} from './Chart';
|
|
@@ -232,6 +231,7 @@ export class ChartJsRenderer extends AbstractChartRenderer {
|
|
|
232
231
|
protected override _render() {
|
|
233
232
|
if (!this.$canvas) {
|
|
234
233
|
this.$canvas = this.chart.$container.appendElement('<canvas>') as JQuery<HTMLCanvasElement>;
|
|
234
|
+
aria.hidden(this.$canvas, true); // aria not supported yet
|
|
235
235
|
}
|
|
236
236
|
this.firstOpaqueBackgroundColor = styles.getFirstOpaqueBackgroundColor(this.$canvas);
|
|
237
237
|
if (!chartJsGlobalsInitialized) {
|
|
@@ -1073,10 +1073,10 @@ export class ChartJsRenderer extends AbstractChartRenderer {
|
|
|
1073
1073
|
let avg = (value.x[0] + value.x[1]) / 2;
|
|
1074
1074
|
tooltipDirection = avg < 0 ? 'left' : 'right';
|
|
1075
1075
|
} else {
|
|
1076
|
-
tooltipDirection = value < 0 ? 'left' : 'right';
|
|
1076
|
+
tooltipDirection = (value as number) < 0 ? 'left' : 'right';
|
|
1077
1077
|
}
|
|
1078
1078
|
} else if ((dataset.type || config.type) === Chart.Type.BAR) {
|
|
1079
|
-
tooltipPosition = value < 0 ? 'bottom' : 'top';
|
|
1079
|
+
tooltipPosition = (value as number) < 0 ? 'bottom' : 'top';
|
|
1080
1080
|
} else if (scout.isOneOf(config.type, Chart.Type.PIE, Chart.Type.DOUGHNUT, Chart.Type.POLAR_AREA)) {
|
|
1081
1081
|
let element = (chart.getDatasetMeta(datasetIndex).data[dataIndex] as unknown as ArcElement).getProps(['startAngle', 'endAngle']);
|
|
1082
1082
|
let startAngle = element.startAngle,
|
|
@@ -1085,8 +1085,8 @@ export class ChartJsRenderer extends AbstractChartRenderer {
|
|
|
1085
1085
|
tooltipPosition = (0 <= angle && angle < Math.PI) ? 'bottom' : 'top';
|
|
1086
1086
|
tooltipDirection = (-Math.PI / 2 <= angle && angle < Math.PI / 2) ? 'right' : 'left';
|
|
1087
1087
|
} else if (config.type === Chart.Type.RADAR) {
|
|
1088
|
-
let element = (chart.getDatasetMeta(datasetIndex).data[dataIndex] as unknown as
|
|
1089
|
-
let angle = element.angle;
|
|
1088
|
+
let element = (chart.getDatasetMeta(datasetIndex).data[dataIndex] as unknown as PointElement).getProps(['angle']);
|
|
1089
|
+
let angle = element.angle as number;
|
|
1090
1090
|
tooltipPosition = (0 <= angle && angle < Math.PI) ? 'bottom' : 'top';
|
|
1091
1091
|
tooltipDirection = (-Math.PI / 2 <= angle && angle < Math.PI / 2) ? 'right' : 'left';
|
|
1092
1092
|
} else if (scout.isOneOf(config.type, Chart.Type.BUBBLE, Chart.Type.SCATTER)) {
|
|
@@ -1229,9 +1229,11 @@ export class ChartJsRenderer extends AbstractChartRenderer {
|
|
|
1229
1229
|
beginAtZero: this._isHorizontalBar(config),
|
|
1230
1230
|
offset: type === Chart.Type.BUBBLE,
|
|
1231
1231
|
grid: {
|
|
1232
|
-
drawBorder: false,
|
|
1233
1232
|
drawTicks: false
|
|
1234
1233
|
},
|
|
1234
|
+
border: {
|
|
1235
|
+
display: false
|
|
1236
|
+
},
|
|
1235
1237
|
ticks: {
|
|
1236
1238
|
padding: 5
|
|
1237
1239
|
}
|
|
@@ -1240,8 +1242,10 @@ export class ChartJsRenderer extends AbstractChartRenderer {
|
|
|
1240
1242
|
scales.x = $.extend(true, {}, {
|
|
1241
1243
|
offset: true,
|
|
1242
1244
|
grid: {
|
|
1243
|
-
display: false
|
|
1244
|
-
|
|
1245
|
+
display: false
|
|
1246
|
+
},
|
|
1247
|
+
border: {
|
|
1248
|
+
display: false
|
|
1245
1249
|
}
|
|
1246
1250
|
}, scales.x);
|
|
1247
1251
|
}
|
|
@@ -1266,17 +1270,21 @@ export class ChartJsRenderer extends AbstractChartRenderer {
|
|
|
1266
1270
|
if (this._isHorizontalBar(config)) {
|
|
1267
1271
|
scales.y = $.extend(true, {}, {
|
|
1268
1272
|
grid: {
|
|
1269
|
-
display: false
|
|
1270
|
-
|
|
1273
|
+
display: false
|
|
1274
|
+
},
|
|
1275
|
+
border: {
|
|
1276
|
+
display: false
|
|
1271
1277
|
}
|
|
1272
1278
|
}, scales.y);
|
|
1273
1279
|
} else {
|
|
1274
1280
|
scales.y = $.extend(true, {}, {
|
|
1275
1281
|
beginAtZero: !scout.isOneOf(type, Chart.Type.BUBBLE, Chart.Type.SCATTER),
|
|
1276
1282
|
grid: {
|
|
1277
|
-
drawBorder: false,
|
|
1278
1283
|
drawTicks: false
|
|
1279
1284
|
},
|
|
1285
|
+
border: {
|
|
1286
|
+
display: false
|
|
1287
|
+
},
|
|
1280
1288
|
ticks: {
|
|
1281
1289
|
padding: 5
|
|
1282
1290
|
}
|
|
@@ -2749,9 +2757,9 @@ export class ChartJsRenderer extends AbstractChartRenderer {
|
|
|
2749
2757
|
yAxisDiffType.grid.drawOnChartArea = false;
|
|
2750
2758
|
}
|
|
2751
2759
|
|
|
2752
|
-
yAxis.
|
|
2760
|
+
yAxis.border.display = true;
|
|
2753
2761
|
yAxis.grid.drawTicks = true;
|
|
2754
|
-
yAxisDiffType.
|
|
2762
|
+
yAxisDiffType.border.display = true;
|
|
2755
2763
|
yAxisDiffType.grid.drawTicks = true;
|
|
2756
2764
|
|
|
2757
2765
|
let yAxisType = (datasets[0].type || type),
|
|
@@ -2816,11 +2824,11 @@ export type LegendLabelGenerator = (chart: ChartJsChart) => LegendItem[];
|
|
|
2816
2824
|
export type ChartEventHandler = (event: ChartEvent, items: ActiveElement[]) => void;
|
|
2817
2825
|
export type LegendEventHandler = (e: ChartEvent, legendItem: LegendItem, legend: LegendElement<any>) => void;
|
|
2818
2826
|
export type ResizeHandler = (chart: ChartJsChart | ChartJs, size: { width: number; height: number }) => void;
|
|
2819
|
-
export type TooltipTitleGenerator = (tooltipItems: TooltipItem<any>[]) => string | string[];
|
|
2827
|
+
export type TooltipTitleGenerator = (tooltipItems: TooltipItem<any>[]) => string | string[] | void;
|
|
2820
2828
|
export type TooltipItemsGenerator = (tooltipItems: TooltipItem<any>[], tooltipLabel: TooltipLabelGenerator, tooltipLabelValue: TooltipLabelValueGenerator, tooltipColor: TooltipLabelColorGenerator) => string;
|
|
2821
|
-
export type TooltipLabelGenerator = (tooltipItem: TooltipItem<any>) => string | string[];
|
|
2829
|
+
export type TooltipLabelGenerator = (tooltipItem: TooltipItem<any>) => string | string[] | void;
|
|
2822
2830
|
export type TooltipLabelValueGenerator = (tooltipItem: TooltipItem<any>) => string | { x: string; y: string };
|
|
2823
|
-
export type TooltipLabelColorGenerator = (tooltipItem: TooltipItem<any>) => TooltipLabelStyle;
|
|
2831
|
+
export type TooltipLabelColorGenerator = (tooltipItem: TooltipItem<any>) => TooltipLabelStyle | void;
|
|
2824
2832
|
export type TooltipRenderer = (context: { chart: ChartJs; tooltip: TooltipModel<any> }) => void;
|
|
2825
2833
|
|
|
2826
2834
|
export type DatasetColors = {
|
|
@@ -2886,11 +2894,3 @@ declare module 'chart.js' {
|
|
|
2886
2894
|
labelValue: TooltipLabelValueGenerator;
|
|
2887
2895
|
}
|
|
2888
2896
|
}
|
|
2889
|
-
|
|
2890
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
2891
|
-
export interface RadarPointElement<T extends RadarProps = RadarProps, O extends PointOptions = PointOptions> extends PointElement<T, O> {
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
export interface RadarProps extends PointProps {
|
|
2895
|
-
angle: number;
|
|
2896
|
-
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
*/
|
|
10
|
-
import {arrays, objects, scout} from '@eclipse-scout/core';
|
|
10
|
+
import {aria, arrays, objects, scout} from '@eclipse-scout/core';
|
|
11
11
|
import {AbstractSvgChartRenderer, Chart} from '../index';
|
|
12
12
|
import $ from 'jquery';
|
|
13
13
|
import {UpdateChartOptions} from './Chart';
|
|
@@ -124,6 +124,8 @@ export class FulfillmentChartRenderer extends AbstractSvgChartRenderer {
|
|
|
124
124
|
} else {
|
|
125
125
|
$arc.attr('d', this.pathSegment(0, end));
|
|
126
126
|
}
|
|
127
|
+
|
|
128
|
+
aria.description(this.$svg, this.session.text('ui.FulfillmentChartAriaDescription', percentage));
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
pathSegment(start: number, end: number): string {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
*/
|
|
10
|
-
import {EnumObject, numbers, RoundingMode} from '@eclipse-scout/core';
|
|
10
|
+
import {aria, EnumObject, numbers, RoundingMode} from '@eclipse-scout/core';
|
|
11
11
|
import {AbstractSvgChartRenderer, Chart} from '../index';
|
|
12
12
|
|
|
13
13
|
export class SpeedoChartRenderer extends AbstractSvgChartRenderer {
|
|
@@ -263,6 +263,7 @@ export class SpeedoChartRenderer extends AbstractSvgChartRenderer {
|
|
|
263
263
|
.addClass('speedo-chart-label')
|
|
264
264
|
.attr('style', 'font-size: ' + this.scaleWeight * 1.55 + 'px;');
|
|
265
265
|
}
|
|
266
|
+
aria.description(this.$svg, this.session.text('ui.SpeedoChartAriaDescription', legendValue, minLegendValue, maxLegendValue));
|
|
266
267
|
}
|
|
267
268
|
|
|
268
269
|
/**
|
|
@@ -41,4 +41,8 @@ export class ChartField extends FormField implements ChartFieldModel {
|
|
|
41
41
|
this.chart.remove();
|
|
42
42
|
this._removeField();
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
protected override _linkWithLabel($element: JQuery) {
|
|
46
|
+
// nop, the chart renderers will take care of labeling and describing the chart
|
|
47
|
+
}
|
|
44
48
|
}
|
|
@@ -966,30 +966,32 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
|
|
969
|
-
protected _formatLabel(label: number
|
|
970
|
-
if (axis) {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
969
|
+
protected _formatLabel(label: number, axis: TableMatrixKeyAxis): string {
|
|
970
|
+
if (!axis) {
|
|
971
|
+
return '' + label;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
if (axis.column instanceof DateColumn) {
|
|
975
|
+
label = label + axis.min;
|
|
976
|
+
if (label !== parseInt('' + label) || (axis.length < 2 && (label < axis.min || label > axis.max))) {
|
|
977
|
+
return null;
|
|
976
978
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
979
|
+
}
|
|
980
|
+
if (axis.indexOf(null) !== -1) {
|
|
981
|
+
if (label === axis.max) {
|
|
982
|
+
label = null;
|
|
983
|
+
} else if (label > axis.max) {
|
|
984
|
+
return null;
|
|
983
985
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
986
|
+
}
|
|
987
|
+
let formatted = axis.format(label);
|
|
988
|
+
if (axis.isIcon) {
|
|
989
|
+
let icon = icons.parseIconId(formatted);
|
|
990
|
+
if (icon && icon.isFontIcon()) {
|
|
991
|
+
formatted = icon.iconCharacter;
|
|
990
992
|
}
|
|
991
993
|
}
|
|
992
|
-
return
|
|
994
|
+
return formatted;
|
|
993
995
|
}
|
|
994
996
|
|
|
995
997
|
protected _adjustConfig(config: ChartConfig) {
|