@openui5/sap.ui.mdc 1.93.3 → 1.96.2
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/.reuse/dep5 +6 -11
- package/THIRDPARTY.txt +10 -16
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +236 -334
- package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -1
- package/src/sap/ui/mdc/Chart.js +150 -22
- package/src/sap/ui/mdc/ChartDelegateNew.js +15 -0
- package/src/sap/ui/mdc/ChartNew.js +107 -66
- package/src/sap/ui/mdc/Control.js +4 -3
- package/src/sap/ui/mdc/Element.js +5 -4
- package/src/sap/ui/mdc/Field.js +2 -2
- package/src/sap/ui/mdc/FilterBar.js +1 -10
- package/src/sap/ui/mdc/FilterField.js +28 -4
- package/src/sap/ui/mdc/Link.js +2 -2
- package/src/sap/ui/mdc/MultiValueField.js +1 -1
- package/src/sap/ui/mdc/Table.js +172 -79
- package/src/sap/ui/mdc/TableDelegate.js +20 -3
- package/src/sap/ui/mdc/ValueHelp.js +1474 -0
- package/src/sap/ui/mdc/ValueHelpDelegate.js +147 -0
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +49 -104
- package/src/sap/ui/mdc/chart/DimensionItem.js +3 -3
- package/src/sap/ui/mdc/chart/Item.js +2 -3
- package/src/sap/ui/mdc/chart/MeasureItem.js +2 -2
- package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +21 -2
- package/src/sap/ui/mdc/chart/ToolbarHandler.js +237 -225
- package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +14 -10
- package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +12 -10
- package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -1
- package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +2 -2
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +13 -7
- package/src/sap/ui/mdc/condition/Operator.js +4 -4
- package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +43 -0
- package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +91 -0
- package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +20 -0
- package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +31 -0
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +5 -0
- package/src/sap/ui/mdc/enum/ContentMode.js +25 -4
- package/src/sap/ui/mdc/enum/SelectType.js +43 -0
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +19 -4
- package/src/sap/ui/mdc/field/ConditionsType.js +5 -4
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +38 -14
- package/src/sap/ui/mdc/field/FieldBase.js +92 -41
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
- package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
- package/src/sap/ui/mdc/field/FieldInfoBase.js +9 -1
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelp.js +7 -1
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -2
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +3 -3
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/field/content/BooleanContent.js +15 -3
- package/src/sap/ui/mdc/field/content/ContentFactory.js +16 -8
- package/src/sap/ui/mdc/field/content/DefaultContent.js +64 -23
- package/src/sap/ui/mdc/field/content/LinkContent.js +6 -0
- package/src/sap/ui/mdc/field/content/SearchContent.js +21 -3
- package/src/sap/ui/mdc/field/content/UnitContent.js +2 -2
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +105 -44
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +52 -0
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +10 -51
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +22 -0
- package/src/sap/ui/mdc/flexibility/ActionToolbarAction.flexibility.js +19 -0
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +57 -46
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
- package/src/sap/ui/mdc/library.js +588 -8
- package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialog.js +2 -2
- package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +31 -5
- package/src/sap/ui/mdc/messagebundle_ar.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_bg.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_ca.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_cs.properties +31 -16
- package/src/sap/ui/mdc/messagebundle_cy.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_da.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_de.properties +20 -5
- package/src/sap/ui/mdc/messagebundle_el.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_en.properties +17 -2
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +11 -3
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +19 -3
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +11 -2
- package/src/sap/ui/mdc/messagebundle_es.properties +43 -28
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_et.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_fi.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_fr.properties +32 -17
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_hi.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_hr.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_hu.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_id.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_it.properties +41 -26
- package/src/sap/ui/mdc/messagebundle_iw.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_ja.properties +28 -13
- package/src/sap/ui/mdc/messagebundle_kk.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_ko.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_lt.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_lv.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_ms.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_nl.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_no.properties +25 -10
- package/src/sap/ui/mdc/messagebundle_pl.properties +22 -7
- package/src/sap/ui/mdc/messagebundle_pt.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_ro.properties +21 -6
- package/src/sap/ui/mdc/messagebundle_ru.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_sh.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_sk.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_sl.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_sv.properties +19 -4
- package/src/sap/ui/mdc/messagebundle_th.properties +24 -9
- package/src/sap/ui/mdc/messagebundle_tr.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_uk.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_vi.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +18 -3
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +18 -3
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +6 -6
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +37 -10
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +492 -203
- package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +3 -2
- package/src/sap/ui/mdc/p13n/P13nBuilder.js +6 -60
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
- package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +22 -24
- package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +59 -0
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +1 -2
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +17 -8
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1 -2
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +1171 -0
- package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/GroupView.js +7 -11
- package/src/sap/ui/mdc/p13n/panels/ListView.js +5 -3
- package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +16 -9
- package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -1
- package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -1
- package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +89 -0
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +9 -6
- package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +33 -4
- package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +9 -15
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +12 -0
- package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +5 -12
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +19 -21
- package/src/sap/ui/mdc/table/Column.js +35 -9
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/GridTableType.js +0 -1
- package/src/sap/ui/mdc/table/PropertyHelper.js +108 -5
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +19 -3
- package/src/sap/ui/mdc/table/RowSettings.js +1 -1
- package/src/sap/ui/mdc/table/TableTypeBase.js +0 -1
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
- package/src/sap/ui/mdc/themes/base/FilterBar.less +2 -2
- package/src/sap/ui/mdc/themes/base/GroupView.less +2 -2
- package/src/sap/ui/mdc/themes/base/ListView.less +2 -2
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +56 -21
- package/src/sap/ui/mdc/ui/Container.js +2 -2
- package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
- package/src/sap/ui/mdc/util/Common.js +26 -0
- package/src/sap/ui/mdc/util/FilterUtil.js +12 -1
- package/src/sap/ui/mdc/util/IdentifierUtil.js +4 -0
- package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
- package/src/sap/ui/mdc/util/PropertyHelper.js +22 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +498 -0
- package/src/sap/ui/mdc/valuehelp/Popover.js +362 -0
- package/src/sap/ui/mdc/valuehelp/base/Container.js +642 -0
- package/src/sap/ui/mdc/valuehelp/base/Content.js +628 -0
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +139 -0
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +557 -0
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +133 -0
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +318 -0
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +276 -0
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +532 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +638 -0
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +916 -0
- package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -2
- package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +48 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsBase.js +310 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsViz.js +39 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsBase.js +118 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsViz.js +137 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/ChartNew.js +24 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +289 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +401 -93
- package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +4 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
- package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
|
@@ -17,7 +17,10 @@ sap.ui.define([
|
|
|
17
17
|
"sap/ui/mdc/chartNew/ChartTypeButtonNew",
|
|
18
18
|
"sap/ui/mdc/chartNew/ItemNew",
|
|
19
19
|
"sap/ui/model/Sorter",
|
|
20
|
-
"sap/m/VBox"
|
|
20
|
+
"sap/m/VBox",
|
|
21
|
+
"sap/ui/base/ManagedObjectObserver",
|
|
22
|
+
"sap/ui/core/ResizeHandler",
|
|
23
|
+
"sap/ui/mdc/p13n/panels/ChartItemPanelNew"
|
|
21
24
|
], function (
|
|
22
25
|
V4ChartDelegate,
|
|
23
26
|
loadModules,
|
|
@@ -31,7 +34,10 @@ sap.ui.define([
|
|
|
31
34
|
ChartTypeButton,
|
|
32
35
|
MDCChartItem,
|
|
33
36
|
Sorter,
|
|
34
|
-
VBox
|
|
37
|
+
VBox,
|
|
38
|
+
ManagedObjectObserver,
|
|
39
|
+
ResizeHandler,
|
|
40
|
+
ChartItemPanel
|
|
35
41
|
) {
|
|
36
42
|
"use strict";
|
|
37
43
|
/**
|
|
@@ -46,6 +52,8 @@ sap.ui.define([
|
|
|
46
52
|
*/
|
|
47
53
|
var ChartDelegate = Object.assign({}, V4ChartDelegate);
|
|
48
54
|
|
|
55
|
+
|
|
56
|
+
var mStateMap = new window.WeakMap();
|
|
49
57
|
//var ChartLibrary;
|
|
50
58
|
var Chart;
|
|
51
59
|
var Dimension;
|
|
@@ -54,9 +62,106 @@ sap.ui.define([
|
|
|
54
62
|
var Measure;
|
|
55
63
|
//var VizPopover;
|
|
56
64
|
var VizTooltip;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
|
|
66
|
+
//API to access state
|
|
67
|
+
ChartDelegate._getState = function (oMDCChart) {
|
|
68
|
+
if (mStateMap.has(oMDCChart)){
|
|
69
|
+
return mStateMap.get(oMDCChart);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Log.info("Couldn't get state for " + oMDCChart.getId());
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
ChartDelegate._setState = function(oMDCChart, oState) {
|
|
76
|
+
mStateMap.set(oMDCChart, oState);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
ChartDelegate._deleteState = function(oMDCChart) {
|
|
80
|
+
|
|
81
|
+
if (this._getState(oMDCChart).vizTooltip) {
|
|
82
|
+
this._getState(oMDCChart).vizTooltip.destroy();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (this._getState(oMDCChart).observer) {
|
|
86
|
+
this._getState(oMDCChart).observer.disconnect();
|
|
87
|
+
this._getState(oMDCChart).observer = null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return mStateMap.delete(oMDCChart);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
ChartDelegate._getChart = function (oMDCChart){
|
|
95
|
+
|
|
96
|
+
if (mStateMap.has(oMDCChart)) {
|
|
97
|
+
return mStateMap.get(oMDCChart).innerChart;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
Log.info("Couldn't get state for " + oMDCChart.getId());
|
|
101
|
+
|
|
102
|
+
return undefined;
|
|
103
|
+
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
ChartDelegate._setChart = function (oMDCChart, oInnerChart) {
|
|
107
|
+
if (mStateMap.has(oMDCChart)) {
|
|
108
|
+
mStateMap.get(oMDCChart).innerChart = oInnerChart;
|
|
109
|
+
} else {
|
|
110
|
+
mStateMap.set(oMDCChart, {innerChart: oInnerChart});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
ChartDelegate._getInnerStructure = function (oMDCChart) {
|
|
115
|
+
if (mStateMap.has(oMDCChart)) {
|
|
116
|
+
return mStateMap.get(oMDCChart).innerStructure;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
Log.info("Couldn't get state for " + oMDCChart.getId());
|
|
120
|
+
|
|
121
|
+
return undefined;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
ChartDelegate._setInnerStructure = function (oMDCChart, oInnerStructure) {
|
|
125
|
+
if (mStateMap.has(oMDCChart)) {
|
|
126
|
+
mStateMap.get(oMDCChart).innerStructure = oInnerStructure;
|
|
127
|
+
} else {
|
|
128
|
+
mStateMap.set(oMDCChart, {innerStructure: oInnerStructure});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
ChartDelegate._getBindingInfoFromState = function (oMDCChart) {
|
|
133
|
+
if (mStateMap.has(oMDCChart)) {
|
|
134
|
+
return mStateMap.get(oMDCChart).bindingInfo;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
Log.info("Couldn't get state for " + oMDCChart.getId());
|
|
138
|
+
|
|
139
|
+
return undefined;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
ChartDelegate._setBindingInfoForState = function (oMDCChart, oBindingInfo) {
|
|
143
|
+
if (mStateMap.has(oMDCChart)) {
|
|
144
|
+
mStateMap.get(oMDCChart).bindingInfo = oBindingInfo;
|
|
145
|
+
} else {
|
|
146
|
+
mStateMap.set(oMDCChart, {bindingInfo: oBindingInfo});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
ChartDelegate._setUpChartObserver = function(oMDCChart) {
|
|
151
|
+
var mChartMap = this._getState(oMDCChart);
|
|
152
|
+
|
|
153
|
+
if (!mChartMap.observer) {
|
|
154
|
+
mChartMap.observer = new ManagedObjectObserver(function(oChange) {
|
|
155
|
+
if (oChange.type === "destroy") {
|
|
156
|
+
this.exit(oChange.object);
|
|
157
|
+
}
|
|
158
|
+
}.bind(this));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
mChartMap.observer.observe(oMDCChart, {
|
|
162
|
+
destroy: true
|
|
163
|
+
});
|
|
164
|
+
};
|
|
60
165
|
|
|
61
166
|
|
|
62
167
|
/**
|
|
@@ -96,15 +201,23 @@ sap.ui.define([
|
|
|
96
201
|
};
|
|
97
202
|
};
|
|
98
203
|
|
|
204
|
+
ChartDelegate.exit = function(oMDCChart) {
|
|
205
|
+
if (this._getInnerStructure(oMDCChart)){
|
|
206
|
+
this._getInnerStructure(oMDCChart).destroy();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
this._deleteState(oMDCChart);
|
|
210
|
+
};
|
|
211
|
+
|
|
99
212
|
/**
|
|
100
213
|
* Toolbar relevant API (WIP)
|
|
101
214
|
*/
|
|
102
|
-
ChartDelegate.zoomIn = function (iValue) {
|
|
103
|
-
this.
|
|
215
|
+
ChartDelegate.zoomIn = function (oMDCChart, iValue) {
|
|
216
|
+
this._getChart(oMDCChart).zoom({direction: "in"});
|
|
104
217
|
};
|
|
105
218
|
|
|
106
|
-
ChartDelegate.zoomOut = function (iValue) {
|
|
107
|
-
this.
|
|
219
|
+
ChartDelegate.zoomOut = function (oMDCChart, iValue) {
|
|
220
|
+
this._getChart(oMDCChart).zoom({direction: "out"});
|
|
108
221
|
};
|
|
109
222
|
|
|
110
223
|
|
|
@@ -112,10 +225,10 @@ sap.ui.define([
|
|
|
112
225
|
* Gets the current zooming information for the inner chart
|
|
113
226
|
* @returns {integer} Current zoom level on the inner chart
|
|
114
227
|
*/
|
|
115
|
-
ChartDelegate.getZoomState = function () {
|
|
228
|
+
ChartDelegate.getZoomState = function (oMDCChart) {
|
|
116
229
|
|
|
117
|
-
if (this.
|
|
118
|
-
return this.
|
|
230
|
+
if (this._getChart(oMDCChart)) {
|
|
231
|
+
return this._getChart(oMDCChart).getZoomInfo(this);
|
|
119
232
|
}
|
|
120
233
|
|
|
121
234
|
};
|
|
@@ -128,8 +241,91 @@ sap.ui.define([
|
|
|
128
241
|
*
|
|
129
242
|
* @returns {object} event handler for chartSelectionDetails
|
|
130
243
|
*/
|
|
131
|
-
ChartDelegate.getInnerChartSelectionHandler = function () {
|
|
132
|
-
return {eventId: "_selectionDetails", listener: this.
|
|
244
|
+
ChartDelegate.getInnerChartSelectionHandler = function (oMDCChart) {
|
|
245
|
+
return {eventId: "_selectionDetails", listener: this._getChart(oMDCChart)};
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* This function is used by P13n to determine which chart type supports which layout options.
|
|
250
|
+
* There might be chart tyoes which do not support certain layout options (i.e. "Axis3").
|
|
251
|
+
* Layout config is defined as followed:
|
|
252
|
+
* {
|
|
253
|
+
* key: string //identifier for the chart type
|
|
254
|
+
* allowedLayoutOptions : [] //array containing allowed layout options as string
|
|
255
|
+
* }
|
|
256
|
+
*
|
|
257
|
+
* @returns {array}
|
|
258
|
+
*/
|
|
259
|
+
ChartDelegate.getChartTypeLayoutConfig = function() {
|
|
260
|
+
|
|
261
|
+
if (this._aChartTypeLayout) {
|
|
262
|
+
return this._aChartTypeLayout;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
var aAxis1Only = [MDCLib.ChartItemRoleType.axis1, MDCLib.ChartItemRoleType.category, MDCLib.ChartItemRoleType.series];
|
|
266
|
+
var aAxis1And2 = [MDCLib.ChartItemRoleType.axis1, MDCLib.ChartItemRoleType.axis2, MDCLib.ChartItemRoleType.category, MDCLib.ChartItemRoleType.series];
|
|
267
|
+
var aCat2Axis1Only = [MDCLib.ChartItemRoleType.axis1, MDCLib.ChartItemRoleType.category, MDCLib.ChartItemRoleType.category2];
|
|
268
|
+
var aCat1AllAxis = [MDCLib.ChartItemRoleType.axis1, MDCLib.ChartItemRoleType.axis2, MDCLib.ChartItemRoleType.axis3, MDCLib.ChartItemRoleType.category, MDCLib.ChartItemRoleType.series];
|
|
269
|
+
|
|
270
|
+
this._aChartTypeLayout = [
|
|
271
|
+
{key: "column", allowedLayoutOptions: aAxis1Only},
|
|
272
|
+
{key: "bar", allowedLayoutOptions: aAxis1Only},
|
|
273
|
+
{key: "line", allowedLayoutOptions: aAxis1Only},
|
|
274
|
+
{key: "combination", allowedLayoutOptions: aAxis1Only},
|
|
275
|
+
{key: "pie", allowedLayoutOptions: aAxis1Only},
|
|
276
|
+
{key: "donut", allowedLayoutOptions: aAxis1Only},
|
|
277
|
+
{key: "dual_column", allowedLayoutOptions: aAxis1And2},
|
|
278
|
+
{key: "dual_bar", allowedLayoutOptions: aAxis1And2},
|
|
279
|
+
{key: "dual_line", allowedLayoutOptions: aAxis1And2},
|
|
280
|
+
{key: "stacked_bar", allowedLayoutOptions: aAxis1Only},
|
|
281
|
+
{key: "scatter", allowedLayoutOptions: aAxis1And2},
|
|
282
|
+
{key: "bubble", allowedLayoutOptions: aCat1AllAxis},
|
|
283
|
+
{key: "heatmap", allowedLayoutOptions: aCat2Axis1Only},
|
|
284
|
+
{key: "bullet", allowedLayoutOptions: aAxis1Only},
|
|
285
|
+
{key: "vertical_bullet", allowedLayoutOptions: aAxis1Only},
|
|
286
|
+
{key: "dual_stacked_bar", allowedLayoutOptions: aAxis1And2},
|
|
287
|
+
{key: "100_stacked_bar", allowedLayoutOptions: aAxis1Only},
|
|
288
|
+
{key: "stacked_column", allowedLayoutOptions: aAxis1Only},
|
|
289
|
+
{key: "dual_stacked_column", allowedLayoutOptions: aAxis1And2},
|
|
290
|
+
{key: "100_stacked_column", allowedLayoutOptions: aAxis1Only},
|
|
291
|
+
{key: "dual_combination", allowedLayoutOptions: aAxis1And2},
|
|
292
|
+
{key: "dual_horizontal_combination", allowedLayoutOptions: aAxis1And2},
|
|
293
|
+
{key: "dual_horizontal_combination", allowedLayoutOptions: aAxis1And2},
|
|
294
|
+
{key: "dual_stacked_combination", allowedLayoutOptions: aAxis1And2},
|
|
295
|
+
{key: "dual_horizontal_stacked_combination", allowedLayoutOptions: aAxis1And2},
|
|
296
|
+
{key: "stacked_combination", allowedLayoutOptions: aAxis1Only},
|
|
297
|
+
{key: "100_dual_stacked_bar", allowedLayoutOptions: aAxis1Only},
|
|
298
|
+
{key: "100_dual_stacked_column", allowedLayoutOptions: aAxis1Only},
|
|
299
|
+
{key: "horizontal_stacked_combination", allowedLayoutOptions: aAxis1Only},
|
|
300
|
+
{key: "waterfall", allowedLayoutOptions: aCat2Axis1Only},
|
|
301
|
+
{key: "horizontal_waterfall", allowedLayoutOptions: aCat2Axis1Only}
|
|
302
|
+
];
|
|
303
|
+
|
|
304
|
+
return this._aChartTypeLayout;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
ChartDelegate.getAdaptionUI = function(oMDCChart) {
|
|
308
|
+
|
|
309
|
+
var oLayoutConfig = this.getChartTypeLayoutConfig().find(function(it){return it.key === oMDCChart.getChartType();});
|
|
310
|
+
|
|
311
|
+
//Default case -> everything allowed
|
|
312
|
+
if (!oLayoutConfig) {
|
|
313
|
+
var aRoles = [MDCLib.ChartItemRoleType.axis1, MDCLib.ChartItemRoleType.axis2, MDCLib.ChartItemRoleType.axis3, MDCLib.ChartItemRoleType.category, MDCLib.ChartItemRoleType.category2, MDCLib.ChartItemRoleType.series];
|
|
314
|
+
oLayoutConfig = {key: oMDCChart.getChartType(), allowedLayoutOptions: aRoles};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
var aStandardSetup = [
|
|
318
|
+
{kind: "Groupable"},
|
|
319
|
+
{kind: "Aggregatable"}
|
|
320
|
+
];
|
|
321
|
+
|
|
322
|
+
oLayoutConfig.templateConfig = aStandardSetup;
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
//var aRolesAvailable = [MDCLib.ChartItemRoleType.axis1, MDCLib.ChartItemRoleType.axis2, MDCLib.ChartItemRoleType.axis3, MDCLib.ChartItemRoleType.category, MDCLib.ChartItemRoleType.category2, MDCLib.ChartItemRoleType.series];
|
|
326
|
+
var oArguments = {panelConfig: oLayoutConfig};
|
|
327
|
+
|
|
328
|
+
return Promise.resolve(new ChartItemPanel(oArguments));
|
|
133
329
|
};
|
|
134
330
|
|
|
135
331
|
/**
|
|
@@ -141,9 +337,9 @@ sap.ui.define([
|
|
|
141
337
|
* @private
|
|
142
338
|
* @ui5-restricted Fiori Elements, sap.ui.mdc
|
|
143
339
|
*/
|
|
144
|
-
ChartDelegate.setLegendVisible = function (bVisible) {
|
|
145
|
-
if (this.
|
|
146
|
-
this.
|
|
340
|
+
ChartDelegate.setLegendVisible = function (oMDCChart, bVisible) {
|
|
341
|
+
if (this._getChart(oMDCChart)) {
|
|
342
|
+
this._getChart(oMDCChart).setVizProperties({
|
|
147
343
|
'legend': {
|
|
148
344
|
'visible': bVisible
|
|
149
345
|
},
|
|
@@ -180,25 +376,38 @@ sap.ui.define([
|
|
|
180
376
|
* @param {sap.ui.mdc.chartNew-ItemNew} oMDCChartItem the MDC CHart Item to insert into the inner chart
|
|
181
377
|
* @param {int} iIndex the index to insert into
|
|
182
378
|
*/
|
|
183
|
-
ChartDelegate.insertItemToInnerChart = function (oMDCChartItem, iIndex) {
|
|
379
|
+
ChartDelegate.insertItemToInnerChart = function (oMDCChart, oMDCChartItem, iIndex) {
|
|
184
380
|
//TODO: Create Measures/Dimension only when required?
|
|
185
381
|
if (oMDCChartItem.getType() === "groupable") {
|
|
186
|
-
|
|
187
|
-
var
|
|
382
|
+
|
|
383
|
+
var oDim = this._getChart(oMDCChart).getDimensionByName(oMDCChartItem.getName());
|
|
384
|
+
|
|
385
|
+
if (!oDim) {
|
|
386
|
+
this.createInnerDimension(oMDCChart, oMDCChartItem);
|
|
387
|
+
} else {
|
|
388
|
+
//Update Dimension
|
|
389
|
+
oDim.setLabel(oMDCChartItem.getLabel());
|
|
390
|
+
oDim.setRole(oMDCChartItem.getRole() ? oMDCChartItem.getRole() : "category");
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
var aVisibleDimension = this._getChart(oMDCChart).getVisibleDimensions();
|
|
188
394
|
aVisibleDimension.splice(iIndex, 0, oMDCChartItem.getName()); //Insert Item without deleting existing dimension
|
|
189
|
-
this.
|
|
395
|
+
this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimension);
|
|
396
|
+
|
|
190
397
|
} else if (oMDCChartItem.getType() === "aggregatable") {
|
|
191
|
-
this.createInnerMeasure(oMDCChartItem);
|
|
192
|
-
var aVisibleMeasures = this.
|
|
398
|
+
this.createInnerMeasure(oMDCChart, oMDCChartItem);
|
|
399
|
+
var aVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures();
|
|
193
400
|
aVisibleMeasures.splice(iIndex, 0, this._getAggregatedMeasureNameForMDCItem(oMDCChartItem));
|
|
194
|
-
this.
|
|
401
|
+
this._getChart(oMDCChart).setVisibleMeasures(aVisibleMeasures);
|
|
195
402
|
}
|
|
196
403
|
|
|
197
404
|
//Update coloring and semantical patterns on Item change
|
|
198
|
-
this._prepareColoringForItem(oMDCChartItem)
|
|
199
|
-
|
|
405
|
+
this._prepareColoringForItem(oMDCChartItem).then(function(){
|
|
406
|
+
this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
|
|
407
|
+
}.bind(this));
|
|
408
|
+
|
|
200
409
|
this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
|
|
201
|
-
this._updateSemanticalPattern(aProperties);
|
|
410
|
+
this._updateSemanticalPattern(oMDCChart, aProperties);
|
|
202
411
|
}.bind(this));
|
|
203
412
|
};
|
|
204
413
|
|
|
@@ -207,27 +416,33 @@ sap.ui.define([
|
|
|
207
416
|
* This function is called by MDC Chart on a change of the <code>Items</code> aggregation
|
|
208
417
|
* @param {sap.ui.mdc.chartNew.ItemNew} oMDCChartItem The Item to remove from the inner chart
|
|
209
418
|
*/
|
|
210
|
-
ChartDelegate.removeItemFromInnerChart = function (oMDCChartItem) {
|
|
211
|
-
if (oMDCChartItem.getType() === "groupable" && this.
|
|
212
|
-
var aNewVisibleDimensions = this.
|
|
419
|
+
ChartDelegate.removeItemFromInnerChart = function (oMDCChart, oMDCChartItem) {
|
|
420
|
+
if (oMDCChartItem.getType() === "groupable" && this._getChart(oMDCChart).getVisibleDimensions().includes(oMDCChartItem.getName())) {
|
|
421
|
+
var aNewVisibleDimensions = this._getChart(oMDCChart).getVisibleDimensions().filter(function (e) {
|
|
213
422
|
return e !== oMDCChartItem.getName();
|
|
214
423
|
});
|
|
215
|
-
this._oInnerChart.setVisibleDimensions(aNewVisibleDimensions);
|
|
216
424
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
425
|
+
if (oMDCChart.getDelegate().inResultDimensions && oMDCChart.getDelegate().inResultDimensions instanceof Array) {
|
|
426
|
+
this._getChart(oMDCChart).setInResultDimensions(oMDCChart.getDelegate().inResultDimensions);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
this._getChart(oMDCChart).setVisibleDimensions(aNewVisibleDimensions);
|
|
430
|
+
|
|
431
|
+
//this._getChart(oMDCChart).removeDimension(this._getChart(oMDCChart).getDimensionByName(oMDCChartItem.getName()));
|
|
432
|
+
|
|
433
|
+
} else if (oMDCChartItem.getType() === "aggregatable" && this._getChart(oMDCChart).getVisibleMeasures().includes(this._getAggregatedMeasureNameForMDCItem(oMDCChartItem))) {
|
|
434
|
+
var aNewVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures().filter(function (e) {
|
|
220
435
|
return e !== this._getAggregatedMeasureNameForMDCItem(oMDCChartItem);
|
|
221
436
|
}.bind(this));
|
|
222
|
-
this.
|
|
437
|
+
this._getChart(oMDCChart).setVisibleMeasures(aNewVisibleMeasures);
|
|
223
438
|
|
|
224
|
-
this.
|
|
439
|
+
this._getChart(oMDCChart).removeMeasure(this._getChart(oMDCChart).getMeasureByName(this._getAggregatedMeasureNameForMDCItem(oMDCChartItem)));
|
|
225
440
|
}
|
|
226
441
|
|
|
227
442
|
//Update coloring and semantical patterns on Item change
|
|
228
|
-
this._updateColoring(this.
|
|
443
|
+
this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
|
|
229
444
|
this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
|
|
230
|
-
this._updateSemanticalPattern(aProperties);
|
|
445
|
+
this._updateSemanticalPattern(oMDCChart, aProperties);
|
|
231
446
|
}.bind(this));
|
|
232
447
|
};
|
|
233
448
|
|
|
@@ -291,24 +506,25 @@ sap.ui.define([
|
|
|
291
506
|
* @returns {Promise} resolved when inner chart is ready
|
|
292
507
|
*/
|
|
293
508
|
ChartDelegate.initializeInnerChart = function (oMDCChart) {
|
|
294
|
-
this._oMDCChart = oMDCChart;
|
|
295
509
|
|
|
296
510
|
return new Promise(function (resolve, reject) {
|
|
297
511
|
|
|
298
512
|
this._loadChart().then(function (aModules) {
|
|
299
513
|
|
|
300
|
-
this.
|
|
514
|
+
this._setInnerStructure(oMDCChart, new VBox({
|
|
301
515
|
justifyContent: "Center",
|
|
302
516
|
alignItems: "Center",
|
|
303
517
|
height: "100%",
|
|
304
518
|
width: "100%"
|
|
305
|
-
});
|
|
519
|
+
}));
|
|
306
520
|
var oText = new Text();
|
|
307
521
|
oText.setText(oMDCChart.getNoDataText());
|
|
308
522
|
|
|
309
|
-
this.
|
|
523
|
+
this._getInnerStructure(oMDCChart).addItem(oText);
|
|
524
|
+
|
|
525
|
+
this._setUpChartObserver(oMDCChart);
|
|
310
526
|
|
|
311
|
-
resolve(this.
|
|
527
|
+
resolve(this._getInnerStructure(oMDCChart)); //Not applicable in this case
|
|
312
528
|
}.bind(this));
|
|
313
529
|
}.bind(this));
|
|
314
530
|
};
|
|
@@ -343,38 +559,14 @@ sap.ui.define([
|
|
|
343
559
|
switch (oItem.getType()) {
|
|
344
560
|
case "groupable":
|
|
345
561
|
aVisibleDimensions.push(oItem.getName());
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
if (oPropertyInfo.textProperty){
|
|
349
|
-
oDimension.setTextProperty(oPropertyInfo.textProperty);
|
|
350
|
-
oDimension.setDisplayText(true);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
this._oInnerChart.addDimension(oDimension);
|
|
562
|
+
this._addInnerDimension(oMDCChart, oItem, oPropertyInfo);
|
|
354
563
|
break;
|
|
355
564
|
case "aggregatable":
|
|
356
565
|
|
|
357
|
-
var aggregationMethod = oPropertyInfo.aggregationMethod;
|
|
358
|
-
var propertyPath = oPropertyInfo.propertyPath;
|
|
359
|
-
|
|
360
566
|
//TODO: Alias might be changing after backend request
|
|
361
567
|
aVisibleMeasures.push(this._getAggregatedMeasureNameForMDCItem(oItem));
|
|
362
568
|
|
|
363
|
-
|
|
364
|
-
name: this._getAggregatedMeasureNameForMDCItem(oItem),//"average" + oItem.getName(),
|
|
365
|
-
label: oItem.getLabel(),
|
|
366
|
-
role: oItem.getRole() ? oItem.getRole() : "axis1"
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
if (aggregationMethod && propertyPath) {
|
|
370
|
-
oMeasureSettings.analyticalInfo = {
|
|
371
|
-
propertyPath: propertyPath,
|
|
372
|
-
"with": aggregationMethod
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
var oMeasure = new Measure(oMeasureSettings);
|
|
377
|
-
this._oInnerChart.addMeasure(oMeasure);
|
|
569
|
+
this._addInnerMeasure(oMDCChart, oItem, oPropertyInfo);
|
|
378
570
|
break;
|
|
379
571
|
|
|
380
572
|
default:
|
|
@@ -384,64 +576,96 @@ sap.ui.define([
|
|
|
384
576
|
aColorPromises.push(this._prepareColoringForItem(oItem));
|
|
385
577
|
}.bind(this));
|
|
386
578
|
|
|
387
|
-
aColMeasures.forEach(function(sKey) {
|
|
579
|
+
this._getState(oMDCChart).aColMeasures.forEach(function(sKey) {
|
|
388
580
|
|
|
389
|
-
if (aInSettings.indexOf(sKey) == -1) {
|
|
581
|
+
if (this._getState(oMDCChart).aInSettings.indexOf(sKey) == -1) {
|
|
390
582
|
|
|
391
583
|
var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
|
|
392
584
|
return oCurrentPropertyInfo.name === sKey;
|
|
393
585
|
});
|
|
394
586
|
|
|
395
|
-
var
|
|
396
|
-
|
|
587
|
+
var aggregationMethod = oPropertyInfo.aggregationMethod;
|
|
588
|
+
var propertyPath = oPropertyInfo.propertyPath;
|
|
589
|
+
|
|
590
|
+
var oMeasureSettings = {
|
|
591
|
+
name: sKey,
|
|
397
592
|
label: oPropertyInfo.label,
|
|
398
|
-
role: "axis1"
|
|
399
|
-
|
|
400
|
-
propertyPath: oPropertyInfo.name, //TODO: What to fill here without PropertyInfos? Consider property at MDC Item level
|
|
401
|
-
"with": oPropertyInfo.aggregationMethod
|
|
402
|
-
}
|
|
403
|
-
});
|
|
593
|
+
role: "axis1"
|
|
594
|
+
};
|
|
404
595
|
|
|
405
|
-
|
|
406
|
-
|
|
596
|
+
if (aggregationMethod && propertyPath) {
|
|
597
|
+
oMeasureSettings.analyticalInfo = {
|
|
598
|
+
propertyPath: propertyPath,
|
|
599
|
+
"with": aggregationMethod
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
var oMeasure = new Measure(oMeasureSettings);
|
|
604
|
+
|
|
605
|
+
aVisibleMeasures.push(oMeasure);
|
|
606
|
+
this._getChart(oMDCChart).addMeasure(oMeasure);
|
|
407
607
|
}
|
|
408
608
|
|
|
409
609
|
}.bind(this));
|
|
410
610
|
|
|
411
611
|
Promise.all(aColorPromises).then(function(){
|
|
412
|
-
this.
|
|
413
|
-
this.
|
|
612
|
+
this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimensions);
|
|
613
|
+
this._getChart(oMDCChart).setVisibleMeasures(aVisibleMeasures);
|
|
614
|
+
|
|
615
|
+
var aInResultDimensions = oMDCChart.getDelegate().inResultDimensions;
|
|
616
|
+
if (aInResultDimensions && aInResultDimensions instanceof Array && aInResultDimensions.length != 0) {
|
|
617
|
+
|
|
618
|
+
var aInResultPromises = [];
|
|
414
619
|
|
|
415
|
-
|
|
416
|
-
|
|
620
|
+
aInResultDimensions.forEach(function(sInResultDim){
|
|
621
|
+
|
|
622
|
+
aInResultPromises.push(this._getPropertyInfosByName(sInResultDim, oMDCChart).then(function(oPropertyInfos){
|
|
623
|
+
var oDim = new Dimension({
|
|
624
|
+
name: oPropertyInfos.name,
|
|
625
|
+
label: oPropertyInfos.label
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
this._getChart(oMDCChart).addDimension(oDim);
|
|
629
|
+
}.bind(this)));
|
|
630
|
+
|
|
631
|
+
}.bind(this));
|
|
632
|
+
|
|
633
|
+
Promise.all(aInResultPromises).then(function(){
|
|
634
|
+
this._getChart(oMDCChart).setInResultDimensions(oMDCChart.getDelegate().inResultDimensions);
|
|
635
|
+
}.bind(this));
|
|
636
|
+
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
this._updateColoring(oMDCChart, aVisibleDimensions, aVisibleMeasures);
|
|
640
|
+
this._updateSemanticalPattern(oMDCChart, aProperties);
|
|
417
641
|
}.bind(this));
|
|
418
642
|
|
|
419
643
|
}.bind(this));
|
|
420
644
|
|
|
421
645
|
};
|
|
422
646
|
|
|
423
|
-
ChartDelegate.getInnerChart = function () {
|
|
424
|
-
return this.
|
|
647
|
+
ChartDelegate.getInnerChart = function (oMDCChart) {
|
|
648
|
+
return this._getChart(oMDCChart);
|
|
425
649
|
};
|
|
426
650
|
|
|
427
651
|
|
|
428
652
|
ChartDelegate._prepareColoringForItem = function(oItem) {
|
|
429
653
|
//COLORING
|
|
430
654
|
return this._addCriticality(oItem).then(function(){
|
|
431
|
-
aInSettings.push(oItem.getName());
|
|
655
|
+
this._getState(oItem.getParent()).aInSettings.push(oItem.getName());
|
|
432
656
|
|
|
433
657
|
if (oItem.getType === "aggregatable") {
|
|
434
658
|
|
|
435
659
|
this._getPropertyInfosByName(oItem.getName(), oItem.getParent()).then(function (oPropertyInfo) {
|
|
436
660
|
for (var j = 0; j < this._getAdditionalColoringMeasuresForItem(oPropertyInfo); j++) {
|
|
437
661
|
|
|
438
|
-
if (aColMeasures.indexOf(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]) == -1) {
|
|
439
|
-
aColMeasures.push(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]);
|
|
662
|
+
if (this._getState(oItem.getParent()).aColMeasures.indexOf(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]) == -1) {
|
|
663
|
+
this._getState(oItem.getParent()).aColMeasures.push(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]);
|
|
440
664
|
}
|
|
441
665
|
}
|
|
442
666
|
}.bind(this));
|
|
443
667
|
}
|
|
444
|
-
});
|
|
668
|
+
}.bind(this));
|
|
445
669
|
|
|
446
670
|
};
|
|
447
671
|
|
|
@@ -472,7 +696,7 @@ sap.ui.define([
|
|
|
472
696
|
return this._getPropertyInfosByName(oItem.getName(), oItem.getParent()).then(function (oPropertyInfo) {
|
|
473
697
|
|
|
474
698
|
if (oPropertyInfo.criticality || (oPropertyInfo.datapoint && oPropertyInfo.datapoint.criticality)){
|
|
475
|
-
oColorings = oColorings || {
|
|
699
|
+
var oColorings = this._getState(oItem.getParent()).oColorings || {
|
|
476
700
|
Criticality: {
|
|
477
701
|
DimensionValues: {},
|
|
478
702
|
MeasureValues: {}
|
|
@@ -493,6 +717,7 @@ sap.ui.define([
|
|
|
493
717
|
}
|
|
494
718
|
|
|
495
719
|
oColorings.Criticality.DimensionValues[oItem.getName()] = mChartCrit;
|
|
720
|
+
|
|
496
721
|
} else {
|
|
497
722
|
var mCrit = oPropertyInfo.datapoint && oPropertyInfo.datapoint.criticality ? oPropertyInfo.datapoint.criticality : [];
|
|
498
723
|
|
|
@@ -502,9 +727,14 @@ sap.ui.define([
|
|
|
502
727
|
|
|
503
728
|
oColorings.Criticality.MeasureValues[oItem.getName()] = mChartCrit;
|
|
504
729
|
}
|
|
730
|
+
|
|
731
|
+
var oState = this._getState(oItem.getParent());
|
|
732
|
+
oState.oColorings = oColorings;
|
|
733
|
+
this._setState(oItem.getParent(), oState);
|
|
734
|
+
|
|
505
735
|
}
|
|
506
736
|
|
|
507
|
-
});
|
|
737
|
+
}.bind(this));
|
|
508
738
|
|
|
509
739
|
};
|
|
510
740
|
|
|
@@ -518,8 +748,8 @@ sap.ui.define([
|
|
|
518
748
|
* @private
|
|
519
749
|
* @ui5-restricted Fiori Elements
|
|
520
750
|
*/
|
|
521
|
-
ChartDelegate._updateColoring = function (aVisibleDimensions, aVisibleMeasures) {
|
|
522
|
-
var oTempColorings = jQuery.extend(true, {}, oColorings), k;
|
|
751
|
+
ChartDelegate._updateColoring = function (oMDCChart, aVisibleDimensions, aVisibleMeasures) {
|
|
752
|
+
var oTempColorings = jQuery.extend(true, {}, this._getState(oMDCChart).oColorings), k;
|
|
523
753
|
|
|
524
754
|
if (oTempColorings && oTempColorings.Criticality) {
|
|
525
755
|
var oActiveColoring;
|
|
@@ -527,7 +757,7 @@ sap.ui.define([
|
|
|
527
757
|
//dimensions overrule
|
|
528
758
|
for (k = 0; k < aVisibleDimensions.length; k++) {
|
|
529
759
|
|
|
530
|
-
if (oColorings.Criticality.DimensionValues[aVisibleDimensions[k]]) {
|
|
760
|
+
if (this._getState(oMDCChart).oColorings.Criticality.DimensionValues[aVisibleDimensions[k]]) {
|
|
531
761
|
oActiveColoring = {
|
|
532
762
|
coloring: "Criticality",
|
|
533
763
|
parameters: {
|
|
@@ -559,8 +789,8 @@ sap.ui.define([
|
|
|
559
789
|
}
|
|
560
790
|
|
|
561
791
|
if (oActiveColoring) {
|
|
562
|
-
this.
|
|
563
|
-
this.
|
|
792
|
+
this._getChart(oMDCChart).setColorings(oTempColorings);
|
|
793
|
+
this._getChart(oMDCChart).setActiveColoring(oActiveColoring);
|
|
564
794
|
}
|
|
565
795
|
}
|
|
566
796
|
};
|
|
@@ -576,9 +806,9 @@ sap.ui.define([
|
|
|
576
806
|
* @private
|
|
577
807
|
* @ui5-restricted Fiori Elements, sap.ui.mdc
|
|
578
808
|
*/
|
|
579
|
-
ChartDelegate._updateSemanticalPattern = function (aProperties) {
|
|
809
|
+
ChartDelegate._updateSemanticalPattern = function (oMDCChart, aProperties) {
|
|
580
810
|
|
|
581
|
-
var aVisibleMeasures = this.
|
|
811
|
+
var aVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures();
|
|
582
812
|
|
|
583
813
|
aVisibleMeasures.forEach(function(sVisibleMeasureName){
|
|
584
814
|
//first draft only with semantic pattern
|
|
@@ -595,12 +825,12 @@ sap.ui.define([
|
|
|
595
825
|
if (oDataPoint) {
|
|
596
826
|
|
|
597
827
|
if (oDataPoint.targetValue || oDataPoint.foreCastValue) {
|
|
598
|
-
var oActualMeasure = this.
|
|
828
|
+
var oActualMeasure = this._getChart(oMDCChart).getMeasureByName(sVisibleMeasureName);
|
|
599
829
|
|
|
600
830
|
oActualMeasure.setSemantics("actual");
|
|
601
831
|
|
|
602
832
|
if (oDataPoint.targetValue != null) {
|
|
603
|
-
var oReferenceMeasure = this.
|
|
833
|
+
var oReferenceMeasure = this._getChart(oMDCChart).getMeasureByName(oDataPoint.targetValue);
|
|
604
834
|
|
|
605
835
|
if (oReferenceMeasure) {
|
|
606
836
|
oReferenceMeasure.setSemantics("reference");
|
|
@@ -610,7 +840,7 @@ sap.ui.define([
|
|
|
610
840
|
}
|
|
611
841
|
|
|
612
842
|
if (oDataPoint.foreCastValue) {
|
|
613
|
-
var oProjectionMeasure = this.
|
|
843
|
+
var oProjectionMeasure = this._getChart(oMDCChart).getMeasureByName(oDataPoint.foreCastValue);
|
|
614
844
|
|
|
615
845
|
if (oProjectionMeasure) {
|
|
616
846
|
oProjectionMeasure.setSemantics("projected");
|
|
@@ -639,12 +869,12 @@ sap.ui.define([
|
|
|
639
869
|
* @returns {object} information about the current chart type
|
|
640
870
|
* @throws exception if inner chart is not yet ready
|
|
641
871
|
*/
|
|
642
|
-
ChartDelegate.getChartTypeInfo = function () {
|
|
643
|
-
if (!this.
|
|
872
|
+
ChartDelegate.getChartTypeInfo = function (oMDCChart) {
|
|
873
|
+
if (!this._getChart(oMDCChart)) {
|
|
644
874
|
throw 'inner chart is not bound';
|
|
645
875
|
}
|
|
646
876
|
|
|
647
|
-
var sType =
|
|
877
|
+
var sType = oMDCChart.getChartType(),
|
|
648
878
|
oMDCResourceBundle = Core.getLibraryResourceBundle("sap.ui.mdc");
|
|
649
879
|
|
|
650
880
|
var mInfo = {
|
|
@@ -666,11 +896,11 @@ sap.ui.define([
|
|
|
666
896
|
* @private
|
|
667
897
|
* @ui5-restricted Fiori Elements
|
|
668
898
|
*/
|
|
669
|
-
ChartDelegate.getAvailableChartTypes = function () {
|
|
899
|
+
ChartDelegate.getAvailableChartTypes = function (oMDCChart) {
|
|
670
900
|
var aChartTypes = [];
|
|
671
901
|
|
|
672
|
-
if (this.
|
|
673
|
-
var aAvailableChartTypes = this.
|
|
902
|
+
if (this._getChart(oMDCChart)) {
|
|
903
|
+
var aAvailableChartTypes = this._getChart(oMDCChart).getAvailableChartTypes().available;
|
|
674
904
|
|
|
675
905
|
if (aChartTypes) {
|
|
676
906
|
|
|
@@ -682,7 +912,7 @@ sap.ui.define([
|
|
|
682
912
|
key: sType,
|
|
683
913
|
icon: ChartTypeButton.mMatchingIcon[sType],
|
|
684
914
|
text: oChartResourceBundle.getText("info/" + sType),
|
|
685
|
-
selected: (sType ==
|
|
915
|
+
selected: (sType == oMDCChart.getChartType())
|
|
686
916
|
});
|
|
687
917
|
}
|
|
688
918
|
}
|
|
@@ -701,9 +931,9 @@ sap.ui.define([
|
|
|
701
931
|
* The returned objects need at least a "label" and a "name" property
|
|
702
932
|
* @returns {array} Array containing the drill stack
|
|
703
933
|
*/
|
|
704
|
-
ChartDelegate.getDrillStack = function () {
|
|
934
|
+
ChartDelegate.getDrillStack = function (oMDCChart) {
|
|
705
935
|
//TODO: Generify the return values here for other chart frameworks
|
|
706
|
-
return this.
|
|
936
|
+
return this._getChart(oMDCChart).getDrillStack();
|
|
707
937
|
};
|
|
708
938
|
|
|
709
939
|
/**
|
|
@@ -752,8 +982,8 @@ sap.ui.define([
|
|
|
752
982
|
* Is called by MDC Chart when <code>chartType</code> property is updated
|
|
753
983
|
* @param {string} sChartType the new chart type
|
|
754
984
|
*/
|
|
755
|
-
ChartDelegate.setChartType = function (sChartType) {
|
|
756
|
-
this.
|
|
985
|
+
ChartDelegate.setChartType = function (oMDCChart, sChartType) {
|
|
986
|
+
this._getChart(oMDCChart).setChartType(sChartType);
|
|
757
987
|
};
|
|
758
988
|
|
|
759
989
|
/**
|
|
@@ -761,47 +991,92 @@ sap.ui.define([
|
|
|
761
991
|
*/
|
|
762
992
|
ChartDelegate.createInnerChartContent = function (oMDCChart, fnCallbackDataLoaded) {
|
|
763
993
|
|
|
764
|
-
|
|
765
|
-
//var oPropertyHelper = oMDCChart.getPropertyHelper();
|
|
766
|
-
//var aGroupableProperties = oPropertyHelper.getAllGroupableProperties();
|
|
767
|
-
//var aAggregatableProperties = oPropertyHelper.getAllAggregatableProperties();
|
|
768
|
-
|
|
769
|
-
//create inner instances for aggregations
|
|
770
|
-
//this.createInnerDimensions(aGroupableProperties);
|
|
771
|
-
//this.createInnerMeasures(aAggregatableProperties, oPropertyHelper);
|
|
772
|
-
//rebind after everything is ready
|
|
773
|
-
|
|
774
|
-
this._oInnerChart = new Chart({
|
|
994
|
+
this._setChart(oMDCChart, new Chart({
|
|
775
995
|
id: oMDCChart.getId() + "--innerChart",
|
|
776
996
|
chartType: "column",
|
|
777
|
-
height: "330px",
|
|
778
997
|
width: "100%",
|
|
779
998
|
isAnalytical: true//,
|
|
780
|
-
});
|
|
999
|
+
}));
|
|
1000
|
+
|
|
1001
|
+
if (oMDCChart.getHeight()){
|
|
1002
|
+
this._getChart(oMDCChart).setHeight(this._calculateInnerChartHeight(oMDCChart));
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
//Set height correctly again if chart changes
|
|
1006
|
+
ResizeHandler.register(oMDCChart, function(){
|
|
1007
|
+
this.adjustChartHeight(oMDCChart);
|
|
1008
|
+
}.bind(this));
|
|
1009
|
+
|
|
1010
|
+
var oState = this._getState(oMDCChart);
|
|
1011
|
+
oState.aColMeasures = [];
|
|
1012
|
+
oState.aInSettings = [];
|
|
1013
|
+
this._setState(oMDCChart, oState);
|
|
1014
|
+
|
|
781
1015
|
//Create initial content during pre-processing
|
|
782
1016
|
this._createContentFromItems(oMDCChart);
|
|
783
1017
|
|
|
784
1018
|
//Since zoom information is not yet available for sap.chart.Chart after data load is complete, do it on renderComplete instead
|
|
785
1019
|
//This is a workaround which is hopefully not needed in other chart libraries
|
|
786
|
-
this.
|
|
787
|
-
|
|
788
|
-
|
|
1020
|
+
this._getChart(oMDCChart).attachRenderComplete(function () {
|
|
1021
|
+
if (this._getState(oMDCChart).toolbarUpdateRequested){
|
|
1022
|
+
oMDCChart._updateToolbar();
|
|
1023
|
+
this._getState(oMDCChart).toolbarUpdateRequested = false;
|
|
1024
|
+
}
|
|
1025
|
+
}.bind(this));
|
|
1026
|
+
|
|
1027
|
+
this._getInnerStructure(oMDCChart).removeAllItems();
|
|
1028
|
+
this._getInnerStructure(oMDCChart).setJustifyContent(sap.m.FlexJustifyContent.Start);
|
|
1029
|
+
this._getInnerStructure(oMDCChart).setAlignItems(sap.m.FlexAlignItems.Stretch);
|
|
1030
|
+
this._getInnerStructure(oMDCChart).addItem(this._getChart(oMDCChart));
|
|
789
1031
|
|
|
790
|
-
|
|
791
|
-
this._oInnerStructure.setJustifyContent(sap.m.FlexJustifyContent.Start);
|
|
792
|
-
this._oInnerStructure.setAlignItems(sap.m.FlexAlignItems.Stretch);
|
|
793
|
-
this._oInnerStructure.addItem(this._oInnerChart);
|
|
1032
|
+
oState.dataLoadedCallback = fnCallbackDataLoaded;
|
|
794
1033
|
|
|
795
|
-
this.
|
|
1034
|
+
this._setState(oMDCChart, oState);
|
|
796
1035
|
var oBindingInfo = this._getBindingInfo(oMDCChart);
|
|
797
1036
|
this.updateBindingInfo(oMDCChart, oBindingInfo); //Applies filters
|
|
798
1037
|
this.rebindChart(oMDCChart, oBindingInfo);
|
|
799
1038
|
};
|
|
800
1039
|
|
|
801
|
-
ChartDelegate.
|
|
1040
|
+
ChartDelegate._calculateInnerChartHeight = function(oMDCChart) {
|
|
1041
|
+
var iTotalHeight = jQuery(oMDCChart.getDomRef()).height();
|
|
1042
|
+
var iToolbarHeight = 0;
|
|
1043
|
+
var oToolbar = oMDCChart.getAggregation("_toolbar");
|
|
1044
|
+
var iBreadcrumbsHeight = 0;
|
|
1045
|
+
var oBreadcrumbs = oMDCChart.getAggregation("_breadcrumbs");
|
|
1046
|
+
|
|
1047
|
+
if (oToolbar){
|
|
1048
|
+
iToolbarHeight = jQuery(oToolbar.getDomRef()).outerHeight(true);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
if (oBreadcrumbs){
|
|
1052
|
+
iBreadcrumbsHeight = jQuery(oBreadcrumbs.getDomRef()).outerHeight(true);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
var iSubHeight = iBreadcrumbsHeight + iToolbarHeight;
|
|
1056
|
+
|
|
1057
|
+
if (!iTotalHeight){
|
|
1058
|
+
return "480px";
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
return iTotalHeight - iSubHeight + "px";
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* Adjust chart height to changed content strucutre, if needed
|
|
1066
|
+
*/
|
|
1067
|
+
ChartDelegate.adjustChartHeight = function(oMDCChart){
|
|
1068
|
+
if (oMDCChart.getHeight() && this._getChart(oMDCChart)){
|
|
1069
|
+
this._getChart(oMDCChart).setHeight(this._calculateInnerChartHeight(oMDCChart));
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
ChartDelegate.requestToolbarUpdate = function(oMDCChart) {
|
|
1074
|
+
this._getState(oMDCChart).toolbarUpdateRequested = true;
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1077
|
+
ChartDelegate.createInnerDimension = function (oMDCChart, oMDCChartItem) {
|
|
802
1078
|
//TODO: Check for Hierachy and Time
|
|
803
1079
|
//TODO: Check for role annotation
|
|
804
|
-
//var aVisibleDimensions = [];
|
|
805
1080
|
|
|
806
1081
|
this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
|
|
807
1082
|
|
|
@@ -809,63 +1084,70 @@ sap.ui.define([
|
|
|
809
1084
|
return oCurrentPropertyInfo.name === oMDCChartItem.getName();
|
|
810
1085
|
});
|
|
811
1086
|
|
|
812
|
-
|
|
813
|
-
name: oMDCChartItem.getName(),
|
|
814
|
-
role: oMDCChartItem.getRole() ? oMDCChartItem.getRole() : "category",
|
|
815
|
-
label: oMDCChartItem.getLabel()
|
|
816
|
-
});
|
|
817
|
-
|
|
818
|
-
if (oPropertyInfo.textProperty){
|
|
819
|
-
oDimension.setTextProperty(oPropertyInfo.textProperty);
|
|
820
|
-
oDimension.setDisplayText(true);
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
this._oInnerChart.addDimension(oDimension);
|
|
1087
|
+
this._addInnerDimension(oMDCChart, oMDCChartItem, oPropertyInfo);
|
|
824
1088
|
|
|
825
1089
|
}.bind(this));
|
|
826
1090
|
|
|
827
|
-
|
|
828
|
-
//add to visibleDimensions
|
|
829
|
-
//TODO: Check this
|
|
830
|
-
/*
|
|
831
|
-
if (oProperty.isVisible()){
|
|
832
|
-
aVisibleDimensions.push(oProperty.getName());
|
|
833
|
-
}*/
|
|
834
|
-
|
|
835
|
-
//this._oInnerChart.setVisibleDimensions(aVisibleDimensions);
|
|
836
1091
|
};
|
|
837
1092
|
|
|
838
|
-
ChartDelegate.createInnerMeasure = function (
|
|
1093
|
+
ChartDelegate.createInnerMeasure = function (oMDCChart, oMDCChartItem) {
|
|
839
1094
|
|
|
840
|
-
this.fetchProperties(
|
|
1095
|
+
this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
|
|
841
1096
|
|
|
842
1097
|
var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
|
|
843
|
-
return oCurrentPropertyInfo.name ===
|
|
1098
|
+
return oCurrentPropertyInfo.name === oMDCChartItem.getName();
|
|
844
1099
|
});
|
|
845
1100
|
|
|
846
|
-
|
|
847
|
-
var propertyPath = oPropertyInfo.propertyPath;
|
|
1101
|
+
this._addInnerMeasure(oMDCChart, oMDCChartItem, oPropertyInfo);
|
|
848
1102
|
|
|
849
|
-
|
|
1103
|
+
}.bind(this));
|
|
850
1104
|
|
|
851
|
-
|
|
852
|
-
name: this._getAggregatedMeasureNameForMDCItem(oMDChartItem),//"average" + oItem.getName(),
|
|
853
|
-
label: oMDChartItem.getLabel(),
|
|
854
|
-
role: oMDChartItem.getRole() ? oMDChartItem.getRole() : "axis1"
|
|
855
|
-
};
|
|
1105
|
+
};
|
|
856
1106
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
1107
|
+
/**
|
|
1108
|
+
* @private
|
|
1109
|
+
*/
|
|
1110
|
+
ChartDelegate._addInnerDimension = function(oMDCChart, oMDCChartItem, oPropertyInfo) {
|
|
1111
|
+
var oDimension = new Dimension({
|
|
1112
|
+
name: oMDCChartItem.getName(),
|
|
1113
|
+
role: oMDCChartItem.getRole() ? oMDCChartItem.getRole() : "category",
|
|
1114
|
+
label: oMDCChartItem.getLabel()
|
|
1115
|
+
});
|
|
1116
|
+
|
|
1117
|
+
if (oPropertyInfo.textProperty){
|
|
1118
|
+
oDimension.setTextProperty(oPropertyInfo.textProperty);
|
|
1119
|
+
if (oPropertyInfo.textFormatter){
|
|
1120
|
+
oDimension.setTextFormatter(oPropertyInfo.textFormatter);
|
|
862
1121
|
}
|
|
1122
|
+
oDimension.setDisplayText(true);
|
|
1123
|
+
}
|
|
863
1124
|
|
|
1125
|
+
this._getChart(oMDCChart).addDimension(oDimension);
|
|
1126
|
+
};
|
|
864
1127
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
1128
|
+
/**
|
|
1129
|
+
* @private
|
|
1130
|
+
*/
|
|
1131
|
+
ChartDelegate._addInnerMeasure = function(oMDCChart, oMDCChartItem, oPropertyInfo) {
|
|
1132
|
+
var aggregationMethod = oPropertyInfo.aggregationMethod;
|
|
1133
|
+
var propertyPath = oPropertyInfo.propertyPath;
|
|
1134
|
+
|
|
1135
|
+
var oMeasureSettings = {
|
|
1136
|
+
name: this._getAggregatedMeasureNameForMDCItem(oMDCChartItem),//"average" + oItem.getName(),
|
|
1137
|
+
label: oMDCChartItem.getLabel(),
|
|
1138
|
+
role: oMDCChartItem.getRole() ? oMDCChartItem.getRole() : "axis1"
|
|
1139
|
+
};
|
|
868
1140
|
|
|
1141
|
+
if (aggregationMethod && propertyPath) {
|
|
1142
|
+
oMeasureSettings.analyticalInfo = {
|
|
1143
|
+
propertyPath: propertyPath,
|
|
1144
|
+
"with": aggregationMethod
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
var oMeasure = new Measure(oMeasureSettings);
|
|
1150
|
+
this._getChart(oMDCChart).addMeasure(oMeasure);
|
|
869
1151
|
};
|
|
870
1152
|
|
|
871
1153
|
ChartDelegate._getAggregatedMeasureNameForProperty = function(oPoperty){
|
|
@@ -879,9 +1161,9 @@ sap.ui.define([
|
|
|
879
1161
|
* @param {object} oBindingInfo The bindingInfo of the chart
|
|
880
1162
|
*/
|
|
881
1163
|
ChartDelegate.rebindChart = function (oMDCChart, oBindingInfo) {
|
|
882
|
-
if (oMDCChart && oBindingInfo && this.
|
|
1164
|
+
if (oMDCChart && oBindingInfo && this._getChart(oMDCChart)) {
|
|
883
1165
|
//TODO: bindData sap.chart.Chart specific and therefore needs to be changed to a general API.
|
|
884
|
-
this._addBindingListener(oBindingInfo, "
|
|
1166
|
+
this._addBindingListener(oBindingInfo, "dataReceived", this._getState(oMDCChart).dataLoadedCallback.bind(oMDCChart));
|
|
885
1167
|
|
|
886
1168
|
//TODO: Clarify why sap.ui.model.odata.v4.ODataListBinding.destroy this.bHasAnalyticalInfo is false
|
|
887
1169
|
//TODO: on second call, as it leads to issues when changing layout options within the settings dialog.
|
|
@@ -891,29 +1173,23 @@ sap.ui.define([
|
|
|
891
1173
|
}
|
|
892
1174
|
|
|
893
1175
|
|
|
894
|
-
this.
|
|
895
|
-
this.
|
|
896
|
-
|
|
1176
|
+
this._getChart(oMDCChart).bindData(oBindingInfo);
|
|
1177
|
+
this._setBindingInfoForState(oMDCChart, oBindingInfo);
|
|
1178
|
+
var oState = this._getState(oMDCChart);
|
|
1179
|
+
oState.innerChartBound = true;
|
|
897
1180
|
}
|
|
898
1181
|
};
|
|
899
1182
|
|
|
900
1183
|
ChartDelegate._getBindingInfo = function (oMDCChart) {
|
|
901
1184
|
|
|
902
|
-
if (this.
|
|
903
|
-
return this.
|
|
1185
|
+
if (this._getBindingInfoFromState(oMDCChart)) {
|
|
1186
|
+
return this._getBindingInfoFromState(oMDCChart);
|
|
904
1187
|
}
|
|
905
1188
|
|
|
906
1189
|
var oMetadataInfo = oMDCChart.getDelegate().payload;
|
|
907
1190
|
var sEntitySetPath = "/" + oMetadataInfo.collectionName;
|
|
908
1191
|
var oBindingInfo = {
|
|
909
|
-
path: sEntitySetPath
|
|
910
|
-
parameters: {
|
|
911
|
-
entitySet: oMetadataInfo.collectionName,
|
|
912
|
-
useBatchRequests: true,
|
|
913
|
-
provideGrandTotals: true,
|
|
914
|
-
provideTotalResultSize: true,
|
|
915
|
-
noPaging: true
|
|
916
|
-
}
|
|
1192
|
+
path: sEntitySetPath
|
|
917
1193
|
};
|
|
918
1194
|
return oBindingInfo;
|
|
919
1195
|
};
|
|
@@ -922,8 +1198,14 @@ sap.ui.define([
|
|
|
922
1198
|
* Returns whether the inner chart is currently bound
|
|
923
1199
|
* @returns {bool} true if inner chart is bound; false if not
|
|
924
1200
|
*/
|
|
925
|
-
ChartDelegate.getInnerChartBound = function () {
|
|
926
|
-
|
|
1201
|
+
ChartDelegate.getInnerChartBound = function (oMDCChart) {
|
|
1202
|
+
var oState = this._getState(oMDCChart);
|
|
1203
|
+
|
|
1204
|
+
if (!oState) {
|
|
1205
|
+
return false;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
return oState.innerChartBound ? true : false;
|
|
927
1209
|
};
|
|
928
1210
|
|
|
929
1211
|
/**
|
|
@@ -972,6 +1254,7 @@ sap.ui.define([
|
|
|
972
1254
|
} else if (oBindingInfo.parameters && oBindingInfo.parameters.$search) {
|
|
973
1255
|
delete oBindingInfo.parameters.$search;
|
|
974
1256
|
}
|
|
1257
|
+
|
|
975
1258
|
}
|
|
976
1259
|
};
|
|
977
1260
|
|
|
@@ -1041,18 +1324,22 @@ sap.ui.define([
|
|
|
1041
1324
|
* Sets tooltips visible/invisible on inner chart
|
|
1042
1325
|
* @param {bool} bFlag true for visible, false for invisible
|
|
1043
1326
|
*/
|
|
1044
|
-
ChartDelegate.setChartTooltipVisibility = function (bFlag) {
|
|
1327
|
+
ChartDelegate.setChartTooltipVisibility = function (oMDCChart, bFlag) {
|
|
1045
1328
|
|
|
1046
|
-
if (this.
|
|
1329
|
+
if (this._getChart(oMDCChart)) {
|
|
1047
1330
|
if (bFlag) {
|
|
1048
|
-
if (!this.
|
|
1049
|
-
|
|
1331
|
+
if (!this._getState(oMDCChart).vizTooltip) {
|
|
1332
|
+
|
|
1333
|
+
var oState = this._getState(oMDCChart);
|
|
1334
|
+
oState.vizTooltip = new VizTooltip();
|
|
1335
|
+
this._setState(oMDCChart, oState);
|
|
1050
1336
|
}
|
|
1051
1337
|
// Make this dynamic for setter calls
|
|
1052
|
-
this._vizTooltip.connect(this._oInnerChart.getVizUid());
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1338
|
+
//this._vizTooltip.connect(this._oInnerChart.getVizUid());
|
|
1339
|
+
this._getState(oMDCChart).vizTooltip.connect(this._getChart(oMDCChart).getVizUid());
|
|
1340
|
+
} else if (this._getState(oMDCChart).vizTooltip) {
|
|
1341
|
+
this._getState(oMDCChart).vizTooltip.destroy();
|
|
1342
|
+
}
|
|
1056
1343
|
} else {
|
|
1057
1344
|
Log.error("Trying to set chart tooltip while inner chart was not yet initialized");
|
|
1058
1345
|
}
|
|
@@ -1220,6 +1507,7 @@ sap.ui.define([
|
|
|
1220
1507
|
role: MDCLib.ChartItemRoleType.category, //standard, normally this should be interpreted from UI.Chart annotation
|
|
1221
1508
|
criticality: null ,//To be implemented by FE
|
|
1222
1509
|
textProperty: oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"] ? oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"].$Path : null //To be implemented by FE
|
|
1510
|
+
//textFormatter: function(){} -> can be used to provide a custom formatter for the textProperty
|
|
1223
1511
|
});
|
|
1224
1512
|
}
|
|
1225
1513
|
}
|
|
@@ -1290,11 +1578,12 @@ sap.ui.define([
|
|
|
1290
1578
|
}
|
|
1291
1579
|
};
|
|
1292
1580
|
|
|
1581
|
+
/*
|
|
1293
1582
|
ChartDelegate._onDataLoadComplete = function (mEventParams) {
|
|
1294
1583
|
if (mEventParams.mParameters.reason === "change" && !mEventParams.mParameters.detailedReason) {
|
|
1295
1584
|
this._fnDataLoadedCallback.call();
|
|
1296
1585
|
}
|
|
1297
|
-
}
|
|
1586
|
+
};*/
|
|
1298
1587
|
|
|
1299
1588
|
return ChartDelegate;
|
|
1300
1589
|
});
|