cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP and SMARTCHART

08-25-2021 1:36 AM
555 views 0 comments
0 Likes
SAP Managed Tags
Subscribe

Hello. I need to build smartchart based on CAP Service. I added annotations but the graph is not showing up. The event handler for the view is not called.

view.xml

    <Shell id="shell">
        <App id="app">
            <pages>
                <Page id="page" title="{i18n>title}">
                    <content>
                    <VBox fitContainer="true">
                        <smartchart:SmartChart id ="smartChartGeneral" enableAutoBinding="true"
                            entitySet="Analytics" useVariantManagement="true"
                            persistencyKey="PKeyChartExample9" useChartPersonalisation="true"
                            header="" showFullScreenButton="true" selectionMode="Multi"
                            showChartTooltip="true" showDrillBreadcrumbs="false"
                            showDetailsButton="false" showDrillButtons="true"
                            showSemanticNavigationButton="true"
                            height="100%"
                            data:dateFormatSettings='\{"pattern":"y MMMM d"\}'>
                            <smartchart:semanticObjectController>
                                <sl:SemanticObjectController
                                    navigationTargetsObtained="onNavigationTargetsObtained" navigate="onNavigate" />
                            </smartchart:semanticObjectController>
                        </smartchart:SmartChart>
                    </VBox>
                    </content>
                </Page>
            </pages>
        </App>
    </Shell>


manifest
        "dataSources": {
            "mainService": {
                "uri": "/v2/service/",
                "type": "OData",
                "settings": {
                    "odataVersion": "2.0"
                }
            }
        }
        "models": {
            "": {
                "dataSource": "mainService",
                "preload": true
            }
        },

cds definition

@Aggregation.ApplySupported.PropertyRestrictions : true
view Reports as
  select from DateEntry {
    
    key ID,
    @Analytics.Dimension : true
   
    employee.id AS employee_id,
    @Analytics.Dimension : true
    employee.name,
    @Analytics.Dimension : true
    skf.id AS skf_id,
    @Analytics.Dimension : true
    skf.description,
    @Analytics.Dimension : true
    shift.id,
    @Analytics.Dimension : true
    shift.name AS shift_name,
    @Analytics.Dimension : true
    entryDate,
    @Analytics.Measure   : true
    @Aggregation.default : #SUM
    value
  };


cds service
entity Analytics as projection on my.Reports;
service CatalogService @(path:'/service')
     //@(requires: 'authenticated-user')

annotate CatalogService.Analytics with @(
    Analytics : { 
        AnalyticalContext : [
            {
                $Type : 'Analytics.AnalyticalContextType',
                Dimension: true,
                Property : 'name'
            },
            {
                $Type : 'Analytics.AnalyticalContextType',
                Dimension: true,
                Property : 'shift_name'
            }, 
            {
                $Type : 'Analytics.AnalyticalContextType',
                Measure:true,
                Property : 'value'
            }                       
        ],

     }
); 


in the console "Assertion failed: ManagedObject.apply: encountered unknown setting 'customData' for class 'sap.ui.comp.navpopover.NavigationPopoverHandler' (value:'Element sap.ui.core.CustomData#__data5')"


0 Likes

Accepted Solutions (0)

Answers (0)