on 06-12-2023 4:52 PM
Hello Experts,
I am currently working with a Smart Chart control and experiencing some issues with the required annotations.
I am able to render the smart chart from the UI using xml annotations. However, the one thing that is missing here is to add the sap:semantics="aggregate" property to the entitySet, which is required in order to aggregate the values in my smart chart.
I have tried various ways of adding this property to the metadata, and have only managed via CAP CDS annotations. Then again, this seems to overwrite / conflict with the xml annotations and the smart chart no longer renders. I would prefer to use only XML annotations - so if someone knows how to add this specific property via XML, please let me know.
My CDS annotations were as follows
annotate service.opportunityHeader with @( Aggregation.ApplySupported : { PropertyRestrictions : true, Transformations : [ 'aggregate', 'topcount', 'bottomcount', 'identity', 'concat', 'groupby', 'filter', 'expand', 'top', 'skip', 'orderby', 'search' ], AggregatableProperties : [{ $Type : 'Aggregation.AggregatablePropertyType', Property : opportunityValue }], GroupableProperties : [ opportunityValue ] }
Would be great to hear some best practices when working with smart charts. Thank you!
Did you try this below link which provide some examples for chart ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is example to use sap:semantics="aggregate"
<EntitySet Name="SalesOrders" EntityType="SalesOrder">
<NavigationPropertyBinding Path="SalesOrderItems" Target="SalesOrderItems"/>
<Annotation Term="Org.OData.Capabilities.V1.FilterRestrictions">
<Record>
<PropertyValue Property="Filterable" Bool="true"/>
<PropertyValue Property="RequiredProperties">
<Collection>
<PropertyPath>Customer</PropertyPath>
<PropertyPath>SalesOrderID</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Org.OData.Capabilities.V1.AggregateRestrictions">
<Record>
<PropertyValue Property="Non-AggregatableProperties">
<Collection>
<PropertyPath>Customer</PropertyPath>
<PropertyPath>SalesOrderID</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Org.OData.Capabilities.V1.TopSupported"/>
<Annotation Term="Org.OData.Capabilities.V1.SkipSupported"/>
<Annotation Term="Org.OData.Capabilities.V1.CountRestrictions">
<Record>
<PropertyValue Property="Countable" Bool="true"/>
</Record>
</Annotation>
<Annotation Term="Org.OData.Capabilities.V1.SelectSupport"/>
<Annotation Term="Org.OData.Capabilities.V1.SearchRestrictions">
<Record/>
</Annotation>
<Annotation Term="com.sap.vocabularies.Common.v1.Label" String="Sales Orders"/>
<Annotation Term="com.sap.vocabularies.Common.v1.Text" Path="Description"/>
<Annotation Term="com.sap.vocabularies.UI.v1.HeaderInfo">
<Record Type="com.sap.vocabularies.UI.v1.HeaderInfoType">
<PropertyValue Property="TypeName" String="SalesOrder"/>
<PropertyValue Property="Title">
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Label" String="Sales Order"/>
<PropertyValue Property="Value" Path=""/>
</Record>
</PropertyValue>
<PropertyValue Property="Description">
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Label" String=""/>
<PropertyValue Property="Value" Path=""/>
</Record>
</PropertyValue>
<PropertyValue Property="ImageUrl" Path=""/>
</Record>
</Annotation>
</EntitySet>
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.