@sapui5/sap.chart 1.119.1 → 1.120.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/package.json +1 -1
- package/src/sap/chart/.library +1 -1
- package/src/sap/chart/AutoScaleMode.js +3 -1
- package/src/sap/chart/Chart.js +144 -135
- package/src/sap/chart/ChartType.js +3 -1
- package/src/sap/chart/ColoringType.js +3 -1
- package/src/sap/chart/ScaleBehavior.js +3 -1
- package/src/sap/chart/TimeUnitType.js +2 -1
- package/src/sap/chart/coloring/CriticalityType.js +3 -1
- package/src/sap/chart/data/DimensionRoleType.js +3 -1
- package/src/sap/chart/data/MeasureRoleType.js +3 -1
- package/src/sap/chart/data/MeasureSemantics.js +3 -1
- package/src/sap/chart/library.js +18 -4
package/package.json
CHANGED
package/src/sap/chart/.library
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides enumeration for sap.chart.AutoScaleMode
|
|
7
|
-
sap.ui.define(function
|
|
7
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
|
|
@@ -28,6 +28,8 @@ sap.ui.define(function () {
|
|
|
28
28
|
VisibleData: "VisibleData"
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
DataType.registerEnum("sap.chart.AutoScaleMode", AutoScaleMode);
|
|
32
|
+
|
|
31
33
|
return AutoScaleMode;
|
|
32
34
|
|
|
33
35
|
}, /* bExport= */ true);
|
package/src/sap/chart/Chart.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
sap.ui.define([
|
|
6
|
+
'sap/base/i18n/Formatting',
|
|
7
|
+
'sap/base/i18n/ResourceBundle',
|
|
6
8
|
'sap/chart/library',
|
|
7
9
|
'sap/viz/ui5/controls/VizFrame',
|
|
8
10
|
'sap/viz/ui5/controls/common/BaseControl',
|
|
@@ -45,6 +47,8 @@ sap.ui.define([
|
|
|
45
47
|
"sap/base/Log",
|
|
46
48
|
"sap/ui/thirdparty/jquery"
|
|
47
49
|
], function(
|
|
50
|
+
Formatting,
|
|
51
|
+
ResourceBundle,
|
|
48
52
|
library,
|
|
49
53
|
VizFrame,
|
|
50
54
|
BaseControl,
|
|
@@ -173,14 +177,14 @@ sap.ui.define([
|
|
|
173
177
|
enablePagination : {type: "boolean", defaultValue: false},
|
|
174
178
|
|
|
175
179
|
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
180
|
+
* Enable Stable color mode.
|
|
181
|
+
* To keep the same colors for the same dimension values or measure names.
|
|
182
|
+
*/
|
|
179
183
|
enableStableColor : {type: "boolean", defaultValue: false},
|
|
180
184
|
|
|
181
185
|
/**
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
* Enable scaling factor.
|
|
187
|
+
*/
|
|
184
188
|
enableScalingFactor : {type: "boolean", defaultValue: false},
|
|
185
189
|
/**
|
|
186
190
|
*
|
|
@@ -311,17 +315,17 @@ sap.ui.define([
|
|
|
311
315
|
* }
|
|
312
316
|
* },
|
|
313
317
|
* stackedMultipleMeasureBoundaryValues: [{
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
318
|
+
* measures: [ 'measure_1', 'measure_2', … ],
|
|
319
|
+
* boundaryValues: {
|
|
320
|
+
* minimum: Number,
|
|
317
321
|
* maximum: Number
|
|
318
|
-
|
|
322
|
+
* }
|
|
319
323
|
* }, {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
324
|
+
* measures: [ 'measure_3', 'measure_4', … ],
|
|
325
|
+
* boundaryValues: {
|
|
326
|
+
* minimum: Number,
|
|
323
327
|
* maximum: Number
|
|
324
|
-
|
|
328
|
+
* }
|
|
325
329
|
* }]
|
|
326
330
|
* },
|
|
327
331
|
* autoScaleSettings: {
|
|
@@ -763,11 +767,14 @@ sap.ui.define([
|
|
|
763
767
|
|
|
764
768
|
Chart.prototype.setVisibleMeasures = function(aMeasureNames, bSuppressInvalidate) {
|
|
765
769
|
this.setProperty("visibleMeasures", aMeasureNames, bSuppressInvalidate);
|
|
766
|
-
var
|
|
770
|
+
var oDrillStateStack = this._drillStateStack || [];
|
|
767
771
|
if (!this._bIsInitialized) {
|
|
768
772
|
this._createDrillStack();
|
|
769
773
|
} else {
|
|
770
|
-
|
|
774
|
+
//Update all drill-stack levels with new visible measures.
|
|
775
|
+
oDrillStateStack.forEach(function(oDrillState){
|
|
776
|
+
oDrillState.measures = this.getProperty("visibleMeasures");
|
|
777
|
+
}.bind(this));
|
|
771
778
|
}
|
|
772
779
|
|
|
773
780
|
this._invalidateBy({
|
|
@@ -783,17 +790,17 @@ sap.ui.define([
|
|
|
783
790
|
};
|
|
784
791
|
|
|
785
792
|
Chart.prototype.setEnableStableColor = function(bValue){
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
793
|
+
bValue = !!bValue;
|
|
794
|
+
if (this.getProperty("enableStableColor") !== bValue){
|
|
795
|
+
this.setProperty("enableStableColor", bValue);
|
|
796
|
+
this._invalidateBy({
|
|
797
|
+
source:this,
|
|
798
|
+
keys:{
|
|
799
|
+
vizFrame:true
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
return this;
|
|
797
804
|
};
|
|
798
805
|
|
|
799
806
|
|
|
@@ -1328,25 +1335,25 @@ sap.ui.define([
|
|
|
1328
1335
|
this._markForUpdate("binding", true);
|
|
1329
1336
|
}
|
|
1330
1337
|
} else if (oSource instanceof Dimension && this._getVisibleDimensions().concat(aAdditionalDims).indexOf(oSource.getName()) !== -1) {
|
|
1331
|
-
|
|
1332
|
-
|
|
1338
|
+
// visible dimensions(including drilled down dimensions)
|
|
1339
|
+
this._markForUpdate("dataSet", true);
|
|
1333
1340
|
this._markForUpdate("vizFrame", true);
|
|
1334
1341
|
if ((oSource.getDisplayText() && (oCause.property === "textProperty" || oCause.property === "displayText" ))) {
|
|
1335
1342
|
this._markForUpdate("binding", true);
|
|
1336
1343
|
} else if (oCause.property === 'level' && this.getProperty('visibleDimensions').indexOf(oSource.getName()) > -1) {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1344
|
+
// reset drill stack when hierarchy level of hierarchy dimension in 'visibleDimensions' is changed
|
|
1345
|
+
this._createDrillStack();
|
|
1346
|
+
this._markForUpdate("binding", true);
|
|
1347
|
+
}
|
|
1341
1348
|
} else if (oSource instanceof Dimension && this.getProperty('inResultDimensions').indexOf(oSource.getName()) > -1) {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1349
|
+
// inResult dimension
|
|
1350
|
+
if (oCause.property === 'level') {
|
|
1351
|
+
this._markForUpdate("dataSet", true);
|
|
1352
|
+
// hierarchy level change will cause binding to request new data
|
|
1353
|
+
this._markForUpdate("binding", true);
|
|
1354
|
+
this._markForUpdate("vizFrame", true);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1350
1357
|
|
|
1351
1358
|
this.invalidate(oCause);
|
|
1352
1359
|
};
|
|
@@ -1418,7 +1425,7 @@ sap.ui.define([
|
|
|
1418
1425
|
var aAdditionalMeasures = oCandidateColoringSetting.additionalMeasures;
|
|
1419
1426
|
if ((aAdditionalDimensions && aAdditionalDimensions.length) ||
|
|
1420
1427
|
(aAdditionalMeasures && aAdditionalMeasures.length)) {
|
|
1421
|
-
|
|
1428
|
+
this._mNeedToUpdate["binding"] = true;
|
|
1422
1429
|
}
|
|
1423
1430
|
},
|
|
1424
1431
|
drillStack: function() {
|
|
@@ -1657,7 +1664,7 @@ sap.ui.define([
|
|
|
1657
1664
|
};
|
|
1658
1665
|
|
|
1659
1666
|
Chart.prototype._getContexts = function() {
|
|
1660
|
-
|
|
1667
|
+
return this._getDataset()._getDataContexts();
|
|
1661
1668
|
};
|
|
1662
1669
|
|
|
1663
1670
|
Chart.prototype._loopContext = function(aContextHandlers) {
|
|
@@ -1988,7 +1995,7 @@ sap.ui.define([
|
|
|
1988
1995
|
Log.error('Chart manages the "data" aggregation only via data binding. The method "removeAllData" therefore cannot be used programmatically!');
|
|
1989
1996
|
};
|
|
1990
1997
|
|
|
1991
|
-
|
|
1998
|
+
Chart.prototype._createOData4SAPAnalyticsModel = function(oModel) {
|
|
1992
1999
|
var oOData4SAPAnalyticsModel = null;
|
|
1993
2000
|
try {
|
|
1994
2001
|
oOData4SAPAnalyticsModel = new odata4analytics.Model(new odata4analytics.Model.ReferenceByModel(oModel));
|
|
@@ -2280,7 +2287,7 @@ sap.ui.define([
|
|
|
2280
2287
|
* @override
|
|
2281
2288
|
*/
|
|
2282
2289
|
Chart.prototype.applySettings = function() {
|
|
2283
|
-
|
|
2290
|
+
this._mNeedToUpdate = {};
|
|
2284
2291
|
|
|
2285
2292
|
Control.prototype.applySettings.apply(this, arguments);
|
|
2286
2293
|
|
|
@@ -2325,8 +2332,8 @@ sap.ui.define([
|
|
|
2325
2332
|
}, this);
|
|
2326
2333
|
|
|
2327
2334
|
this._rendered = false;
|
|
2328
|
-
|
|
2329
|
-
|
|
2335
|
+
//prevent chart to be rendered if no dimension or measure is feed
|
|
2336
|
+
oVizFrame._readyToRender(false);
|
|
2330
2337
|
|
|
2331
2338
|
this.setAggregation("_vizFrame", oVizFrame);
|
|
2332
2339
|
this._delegateEvents();
|
|
@@ -2335,8 +2342,8 @@ sap.ui.define([
|
|
|
2335
2342
|
this._oCandidateColoringSetting = {};
|
|
2336
2343
|
|
|
2337
2344
|
this._oColoringStatus = {};
|
|
2338
|
-
|
|
2339
|
-
|
|
2345
|
+
this._oColorTracker = new SeriesColorTracker();
|
|
2346
|
+
if (this._isEnablePaging()) {
|
|
2340
2347
|
this._getPagingController();
|
|
2341
2348
|
}
|
|
2342
2349
|
};
|
|
@@ -2370,29 +2377,29 @@ sap.ui.define([
|
|
|
2370
2377
|
};
|
|
2371
2378
|
|
|
2372
2379
|
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2380
|
+
/**
|
|
2381
|
+
* Get zoom information.
|
|
2382
|
+
*
|
|
2383
|
+
* Return the zooming enablement and current zooming level of chart.
|
|
2384
|
+
*
|
|
2385
|
+
* Object has the following structure:
|
|
2386
|
+
*
|
|
2387
|
+
* Example:
|
|
2388
|
+
* <pre>
|
|
2389
|
+
* {
|
|
2390
|
+
* "enabled":true,
|
|
2391
|
+
* "currentZoomLevel":0.16
|
|
2392
|
+
* }
|
|
2393
|
+
* </pre>
|
|
2394
|
+
* @public
|
|
2395
|
+
* @since 1.54
|
|
2396
|
+
* @return {object} The zooming enablement and current zooming level of chart.The zooming level is between 0 and 1, and null when zooming isn't applicable.
|
|
2397
|
+
*/
|
|
2391
2398
|
Chart.prototype.getZoomInfo = function() {
|
|
2392
|
-
|
|
2399
|
+
return this._getZoomInfo();
|
|
2393
2400
|
};
|
|
2394
2401
|
|
|
2395
|
-
|
|
2402
|
+
//internal method for customer before version rel-1.54.
|
|
2396
2403
|
Chart.prototype._getZoomInfo = function() {
|
|
2397
2404
|
var oVizFrame = this._getVizFrame();
|
|
2398
2405
|
if (oVizFrame) {
|
|
@@ -3042,7 +3049,7 @@ sap.ui.define([
|
|
|
3042
3049
|
Log.error('Data source does not support drillDown/drillUp. The method "drillUp" therefore cannot be used!');
|
|
3043
3050
|
return;
|
|
3044
3051
|
}
|
|
3045
|
-
|
|
3052
|
+
if (arguments.length === 0) {
|
|
3046
3053
|
iIndex = this._drillStateStack.length - 2;
|
|
3047
3054
|
}
|
|
3048
3055
|
var oNewStackTop = this._drillStateStack[iIndex];
|
|
@@ -3194,20 +3201,20 @@ sap.ui.define([
|
|
|
3194
3201
|
Chart.prototype.setVizProperties = function(oVizProperties) {
|
|
3195
3202
|
oVizProperties = VizPropertiesHelper.sanitize(oVizProperties);
|
|
3196
3203
|
var _mergeProperties = function(destination, source) {
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3204
|
+
for (var sourceKey in source) {
|
|
3205
|
+
var sourceVal = source[sourceKey];
|
|
3206
|
+
if (sourceVal !== undefined) {
|
|
3207
|
+
if (!jQuery.isPlainObject(sourceVal)) {
|
|
3208
|
+
destination[sourceKey] = sourceVal;
|
|
3209
|
+
} else {
|
|
3210
|
+
var destVal = destination[sourceKey];
|
|
3211
|
+
if (!destVal || !jQuery.isPlainObject(destVal)) {
|
|
3212
|
+
destVal = destination[sourceKey] = {};
|
|
3213
|
+
}
|
|
3214
|
+
_mergeProperties(destVal, sourceVal);
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3211
3218
|
};
|
|
3212
3219
|
|
|
3213
3220
|
var mergeProperties = function(destination, source) {
|
|
@@ -3566,8 +3573,8 @@ sap.ui.define([
|
|
|
3566
3573
|
|
|
3567
3574
|
Chart.prototype._getCandidateColoringSetting = function() {
|
|
3568
3575
|
if (!this._bColoringParsed && this._semanticTuples) {
|
|
3569
|
-
|
|
3570
|
-
|
|
3576
|
+
// this method could be called when data responses but chart UI is not shown(tuples are not generated because render is not processed)
|
|
3577
|
+
// so make this._semanticTuples as a dependency for calculating coloring settings here
|
|
3571
3578
|
if (this._enableSemanticColoring()) {
|
|
3572
3579
|
this._bColoringParsed = true;
|
|
3573
3580
|
this._oCandidateColoringSetting = {};
|
|
@@ -3583,39 +3590,41 @@ sap.ui.define([
|
|
|
3583
3590
|
var aRedundantDims = Object.keys(oStackTop.redundant).filter(function(key) {
|
|
3584
3591
|
return key !== 'measureNames';
|
|
3585
3592
|
});
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3593
|
+
}
|
|
3594
|
+
aVisibleDims = this._normalizeDorM(this.getVisibleDimensions().concat(aRedundantDims), true);
|
|
3595
|
+
oDimMsr.aDim = aVisibleDims;
|
|
3589
3596
|
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
+
oDimMsr.aInResultDim = this._normalizeDorM(this.getInResultDimensions(), true);
|
|
3598
|
+
oDimMsr.allMsr = this.getMeasures().map(function(oMsr){
|
|
3599
|
+
return oMsr.getName();
|
|
3600
|
+
});
|
|
3601
|
+
oDimMsr.allDim = this.getDimensions().map(function(oDim){
|
|
3602
|
+
return oDim.getName();
|
|
3603
|
+
});
|
|
3597
3604
|
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3605
|
+
if (oColoring) {
|
|
3606
|
+
try {
|
|
3607
|
+
const oBundle = ResourceBundle.create({
|
|
3608
|
+
bundleName: "sap.chart.messages.messagebundle"
|
|
3609
|
+
});
|
|
3610
|
+
var options = {
|
|
3611
|
+
bFiltered: this._bFilterCalledByCustomer
|
|
3612
|
+
};
|
|
3613
|
+
this._oCandidateColoringSetting = Colorings.getCandidateSetting(oColoring, oActiveColoring, this._semanticTuples, oDimMsr, this._oColoringStatus || {}, this._sAdapteredChartType || this.getChartType(), oBundle, options);
|
|
3614
|
+
//use original chartType here since adapted chartType is not ready in some workflow
|
|
3615
|
+
} catch (e) {
|
|
3616
|
+
if (e instanceof ChartLog) {
|
|
3617
|
+
e.display();
|
|
3618
|
+
} else {
|
|
3619
|
+
throw e;
|
|
3620
|
+
}
|
|
3611
3621
|
}
|
|
3612
3622
|
}
|
|
3623
|
+
} else {
|
|
3624
|
+
this._oCandidateColoringSetting = {};
|
|
3613
3625
|
}
|
|
3614
|
-
} else {
|
|
3615
|
-
this._oCandidateColoringSetting = {};
|
|
3616
|
-
}
|
|
3617
3626
|
|
|
3618
|
-
|
|
3627
|
+
}
|
|
3619
3628
|
return this._oCandidateColoringSetting;
|
|
3620
3629
|
};
|
|
3621
3630
|
|
|
@@ -3636,7 +3645,7 @@ sap.ui.define([
|
|
|
3636
3645
|
return jQuery.extend(true, obj, oSubProp);
|
|
3637
3646
|
}.bind(this), {});
|
|
3638
3647
|
|
|
3639
|
-
|
|
3648
|
+
};
|
|
3640
3649
|
|
|
3641
3650
|
Chart.prototype._getDefaultVizProperties = function() {
|
|
3642
3651
|
// Use UI5 formatter by default in analytic chart
|
|
@@ -3752,9 +3761,9 @@ sap.ui.define([
|
|
|
3752
3761
|
case TimeUnitType.yearweek:
|
|
3753
3762
|
aTimeLevels = ["year", "week"];
|
|
3754
3763
|
|
|
3755
|
-
var
|
|
3756
|
-
oLocaleData = LocaleData.getInstance(
|
|
3757
|
-
region =
|
|
3764
|
+
var oLanguageTag = Formatting.getLanguageTag(),
|
|
3765
|
+
oLocaleData = LocaleData.getInstance(oLanguageTag),
|
|
3766
|
+
region = oLanguageTag.region;
|
|
3758
3767
|
|
|
3759
3768
|
iMinDays = oLocaleData.getMinimalDaysInFirstWeek();
|
|
3760
3769
|
iFirstDayOfWeek = oLocaleData.getFirstDayOfWeek();
|
|
@@ -4071,21 +4080,21 @@ sap.ui.define([
|
|
|
4071
4080
|
};
|
|
4072
4081
|
|
|
4073
4082
|
/**
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4083
|
+
* Export the current chart as SVG String.
|
|
4084
|
+
* The chart is ready to be exported to SVG ONLY after the initialization is finished.
|
|
4085
|
+
* Any attempt to export to SVG before that will result in an empty SVG string.
|
|
4086
|
+
* @public
|
|
4087
|
+
* @param {Object} [option]
|
|
4088
|
+
* <pre>
|
|
4089
|
+
* {
|
|
4090
|
+
* width: Number - the exported svg will be scaled to the specific width.
|
|
4091
|
+
* height: Number - the exported svg will be scaled to the specific height.
|
|
4092
|
+
* hideTitleLegend: Boolean - flag to indicate if the exported SVG includes the original title and legend.
|
|
4093
|
+
* hideAxis: Boolean - flag to indicate if the exported SVG includes the original axis.
|
|
4094
|
+
* }
|
|
4095
|
+
* </pre>
|
|
4096
|
+
* @return {string} the SVG string of the current viz or empty svg if error occurs.
|
|
4097
|
+
*/
|
|
4089
4098
|
Chart.prototype.exportToSVGString = function(option) {
|
|
4090
4099
|
var sSVGString = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\"/>",
|
|
4091
4100
|
oVizFrame = this._getVizFrame();
|
|
@@ -4096,11 +4105,11 @@ sap.ui.define([
|
|
|
4096
4105
|
};
|
|
4097
4106
|
|
|
4098
4107
|
Chart.prototype._getPagingController = function(){
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4108
|
+
if (!this._pagingController){
|
|
4109
|
+
this._pagingController = new PagingController(this);
|
|
4110
|
+
}
|
|
4102
4111
|
|
|
4103
|
-
|
|
4112
|
+
return this._pagingController;
|
|
4104
4113
|
};
|
|
4105
4114
|
|
|
4106
4115
|
return Chart;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides enumeration sap.chart.ChartType
|
|
7
|
-
sap.ui.define(function() {
|
|
7
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
|
|
@@ -173,6 +173,8 @@ sap.ui.define(function() {
|
|
|
173
173
|
HorizontalWaterfall: "horizontal_waterfall"
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
+
DataType.registerEnum("sap.chart.ChartType", ChartType);
|
|
177
|
+
|
|
176
178
|
return ChartType;
|
|
177
179
|
|
|
178
180
|
}, /* bExport= */ true);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides enumeration sap.chart.ColoringType
|
|
7
|
-
sap.ui.define(function() {
|
|
7
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
|
|
@@ -670,6 +670,8 @@ sap.ui.define(function() {
|
|
|
670
670
|
Gradation: "Gradation"
|
|
671
671
|
};
|
|
672
672
|
|
|
673
|
+
DataType.registerEnum("sap.chart.ColoringType", ColoringType);
|
|
674
|
+
|
|
673
675
|
return ColoringType;
|
|
674
676
|
|
|
675
677
|
}, /* bExport= */ true);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides enumeration for sap.chart.ScaleBehavior
|
|
7
|
-
sap.ui.define(function() {
|
|
7
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -27,6 +27,8 @@ sap.ui.define(function() {
|
|
|
27
27
|
FixedScale: "FixedScale"
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
DataType.registerEnum("sap.chart.ScaleBehavior", ScaleBehavior);
|
|
31
|
+
|
|
30
32
|
return ScaleBehavior;
|
|
31
33
|
|
|
32
34
|
}, /* bExport= */ true);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides enumeration sap.chart.TimeUnitType
|
|
7
|
-
sap.ui.define(function() {
|
|
7
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
|
|
@@ -56,6 +56,7 @@ sap.ui.define(function() {
|
|
|
56
56
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
DataType.registerEnum("sap.chart.TimeUnitType", TimeUnitType);
|
|
59
60
|
|
|
60
61
|
return TimeUnitType;
|
|
61
62
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
sap.ui.define(function() {
|
|
6
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
7
7
|
"use strict";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -39,6 +39,8 @@ sap.ui.define(function() {
|
|
|
39
39
|
Neutral: "Neutral"
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
DataType.registerEnum("sap.chart.coloring.CriticalityType", CriticalityType);
|
|
43
|
+
|
|
42
44
|
return CriticalityType;
|
|
43
45
|
|
|
44
46
|
}, /* bExport= */ true);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides enumeration sap.chart.DimensionRoleType
|
|
7
|
-
sap.ui.define(function() {
|
|
7
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
|
|
@@ -36,6 +36,8 @@ sap.ui.define(function() {
|
|
|
36
36
|
category2: "category2"
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
DataType.registerEnum("sap.chart.data.DimensionRoleType", DimensionRoleType);
|
|
40
|
+
|
|
39
41
|
return DimensionRoleType;
|
|
40
42
|
|
|
41
43
|
}, /* bExport= */ true);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides enumeration sap.chart.MeasureRoleType
|
|
7
|
-
sap.ui.define(function() {
|
|
7
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
|
|
@@ -47,6 +47,8 @@ sap.ui.define(function() {
|
|
|
47
47
|
axis4: "axis4"
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
DataType.registerEnum("sap.chart.data.MeasureRoleType", MeasureRoleType);
|
|
51
|
+
|
|
50
52
|
return MeasureRoleType;
|
|
51
53
|
|
|
52
54
|
}, /* bExport= */ true);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (c) Copyright 2009-2023 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
sap.ui.define(function() {
|
|
6
|
+
sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
7
7
|
"use strict";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -31,6 +31,8 @@ sap.ui.define(function() {
|
|
|
31
31
|
Projected: "projected"
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
DataType.registerEnum("sap.chart.data.MeasureSemantics", MeasureSemantics);
|
|
35
|
+
|
|
34
36
|
return MeasureSemantics;
|
|
35
37
|
|
|
36
38
|
}, /* bExport= */ true);
|
package/src/sap/chart/library.js
CHANGED
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
* Initialization Code and shared classes of library sap.chart.
|
|
8
8
|
*/
|
|
9
9
|
sap.ui.define([
|
|
10
|
+
'sap/base/i18n/Localization',
|
|
11
|
+
'sap/base/i18n/ResourceBundle',
|
|
10
12
|
'sap/viz/ui5/format/ChartFormatter',
|
|
13
|
+
'sap/ui/core/Lib',
|
|
11
14
|
'sap/ui/core/library', // library dependency
|
|
12
15
|
'sap/viz/library',
|
|
13
16
|
'sap/chart/utils/RoleFitter',
|
|
@@ -23,7 +26,10 @@ sap.ui.define([
|
|
|
23
26
|
'sap/chart/data/DimensionRoleType',
|
|
24
27
|
'sap/chart/data/MeasureRoleType'
|
|
25
28
|
], function(
|
|
29
|
+
Localization,
|
|
30
|
+
ResourceBundle,
|
|
26
31
|
ChartFormatter,
|
|
32
|
+
Library,
|
|
27
33
|
corelib,
|
|
28
34
|
vizlib,
|
|
29
35
|
RoleFitter,
|
|
@@ -44,7 +50,7 @@ sap.ui.define([
|
|
|
44
50
|
* @alias sap.chart
|
|
45
51
|
* @public
|
|
46
52
|
*/
|
|
47
|
-
|
|
53
|
+
const thisLib = Library.init({
|
|
48
54
|
name: "sap.chart",
|
|
49
55
|
dependencies: ["sap.ui.core", "sap.viz"],
|
|
50
56
|
types: [
|
|
@@ -61,7 +67,7 @@ sap.ui.define([
|
|
|
61
67
|
"sap.chart.data.Measure"
|
|
62
68
|
],
|
|
63
69
|
noLibraryCSS: true,
|
|
64
|
-
version: "1.
|
|
70
|
+
version: "1.120.1"
|
|
65
71
|
});
|
|
66
72
|
|
|
67
73
|
/**
|
|
@@ -138,6 +144,9 @@ sap.ui.define([
|
|
|
138
144
|
*/
|
|
139
145
|
thisLib.api = {};
|
|
140
146
|
|
|
147
|
+
let sBundleLocale;
|
|
148
|
+
let oLibBundle;
|
|
149
|
+
|
|
141
150
|
/**
|
|
142
151
|
* Returns all chart types currently supported by chart control (subset of viz types).
|
|
143
152
|
*
|
|
@@ -146,10 +155,15 @@ sap.ui.define([
|
|
|
146
155
|
* @alias sap.chart.api.getChartTypes
|
|
147
156
|
*/
|
|
148
157
|
thisLib.api.getChartTypes = function() {
|
|
149
|
-
|
|
158
|
+
if (oLibBundle == null || sBundleLocale !== Localization.getLanguage()) {
|
|
159
|
+
sBundleLocale = Localization.getLanguage();
|
|
160
|
+
oLibBundle = ResourceBundle.create({
|
|
161
|
+
bundleName: "sap.chart.messages.messagebundle"
|
|
162
|
+
});
|
|
163
|
+
}
|
|
150
164
|
return Object.keys(ChartType).reduce(function(oMap, sChartTypeKey) {
|
|
151
165
|
var sChartType = ChartType[sChartTypeKey];
|
|
152
|
-
oMap[sChartType] =
|
|
166
|
+
oMap[sChartType] = oLibBundle.getText("info/" + sChartType);
|
|
153
167
|
return oMap;
|
|
154
168
|
}, {});
|
|
155
169
|
};
|