Skip to Content
0

Fiori Overview Page - New Analytical Annotations - Any examples out there?

Oct 20, 2016 at 10:46 AM

1.2k

avatar image

Hi All,

Quite some time back (1.32 UI5 version), I created a demo for the Fiori Overview Page and it had a nice Donut chart on it; but since then the analytical card config and associated annotations have changed (though the old ones still work).

While I've read through the doco, and believe I've created the right annotations, measure and dimension; I can't seem to get the Donut chart to display using the new version (in WebIDE version 1.40).

Anyone have an example using the new card "sap.ovp.cards.charts.analytical" template as opposed to the "sap.ovp.cards.charts.donut" template to display a donut graph?

Thanks,

Matt

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Matt Harding Nov 15, 2016 at 03:23 AM
1

Thanks to Bernhard Siewert and Stefan Engelhardt last week at SAP TechEd, I was able to get this working now (the November update to WebIDE may have also had something to do with this).

In short, just needed to create the Chart annotation (as expected) - set the Measures and Dimensions; then create both the associated ChartMeasureAttributeType (Axis1 role pointing at the DataPoint annotation) and ChartDimensionAttributeType (category role). Then it worked (minimal version shown below for a Donut):

<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
	<edmx:Reference Uri="/sap/bc/ui5_ui5/ui2/ushell/resources/sap/ushell/components/factsheet/vocabularies/UI.xml">
		<edmx:Include Alias="UI" Namespace="com.sap.vocabularies.UI.v1"/>
	</edmx:Reference>
	<edmx:Reference Uri="/sap/bc/ui5_ui5/ui2/ushell/resources/sap/ushell/components/factsheet/vocabularies/Communication.xml">
		<edmx:Include Alias="vCard" Namespace="com.sap.vocabularies.Communication.v1"/>
	</edmx:Reference>
	<edmx:Reference Uri="/sap/bc/ui5_ui5/ui2/ushell/resources/sap/ushell/components/factsheet/vocabularies/Common.xml">
		<edmx:Include Alias="Common" Namespace="com.sap.vocabularies.Common.v1"/>
	</edmx:Reference>
	<edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/vocabularies/Org.OData.Core.V1.xml">
		<edmx:Include Alias="Core" Namespace="Org.OData.Core.V1"/>
	</edmx:Reference>
	<edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs01/vocabularies/Org.OData.Measures.V1.xml">
		<edmx:Include Alias="CQP" Namespace="Org.OData.Measures.V1"/>
	</edmx:Reference>
	<edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs01/vocabularies/Org.OData.Capabilities.V1.xml">
		<edmx:Include Alias="Capabilities" Namespace="Org.OData.Capabilities.V1"/>
	</edmx:Reference>
	<edmx:Reference Uri="http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs02/vocabularies/Org.OData.Aggregation.V1.xml">
		<edmx:Include Alias="Aggregation" Namespace="Org.OData.Aggregation.V1"/>
	</edmx:Reference>
	<edmx:DataServices>
		<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm">
			<Annotations Target="test.odata.SSI2sType">
				<Annotation Term="UI.DataPoint" Qualifier="Duration">
					<Record Type="UI.DataPointType">
						<PropertyValue Property="Title" String="{@i18n>@DURATION}"/>
						<PropertyValue Property="Value" Path="Duration"/>
					</Record>
				</Annotation>
				<Annotation Term="UI.Chart" Qualifier="chart">
					<Record Type="UI.ChartDefinitionType">
						<PropertyValue Property="Title" String="{@i18n>@TEST}"/>
						<PropertyValue Property="Description" String="{@i18n>@TEST}"/>
						<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Donut"/>
						<PropertyValue Property="Measures">
							<Collection>
								<PropertyPath>Duration</PropertyPath>
								<PropertyPath>Counter</PropertyPath>
							</Collection>
						</PropertyValue>
						<PropertyValue Property="MeasureAttributes">
							<Collection>
								<Record Type="UI.ChartMeasureAttributeType">
									<PropertyValue Property="Measure" PropertyPath="Duration"/>
									<PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
									<PropertyValue Property="DataPoint" AnnotationPath="@UI.DataPoint#Duration"/>
								</Record>
							</Collection>
						</PropertyValue>
						<PropertyValue Property="Dimensions">
							<Collection>
								<PropertyPath>RECORDED_BY</PropertyPath>
							</Collection>
						</PropertyValue>
						<PropertyValue Property="DimensionAttributes">
							<Collection>
								<Record Type="UI.ChartDimensionAttributeType">
									<PropertyValue Property="Dimension" PropertyPath="RECORDED_BY"/>
									<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Category"/>
								</Record>
							</Collection>
						</PropertyValue>
						<PropertyValue Property="Actions">
							<Collection/>
						</PropertyValue>
					</Record>
				</Annotation>
				<Annotation Term="UI.Identification" Qualifier="chart">
					<Collection/>
				</Annotation>
			</Annotations>
		</Schema>
	</edmx:DataServices>
</edmx:Edmx>

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 20, 2016 at 02:07 PM
1

Hi Matt,

here is what did the job for me: i created a new entity type containing only those two attribues i needed for my donut chart: one being a string, the other one a float value.

Annotations for the donut chart:

	<Annotations Target="SERVICE_SRV.Priorities"> 
					<Annotation Term="UI.Chart" Qualifier="prioChart">
					<Record Type="UI.ChartDefinitionType">
						<PropertyValue Property="MeasureAttributes">
							<Collection>
								<Record Type="UI.ChartMeasureAttributeType">
									<PropertyValue Property="Measure" PropertyPath="Amount"/>
								</Record>
							</Collection>
						</PropertyValue>
						
						<PropertyValue Property="DimensionAttributes"> 
							<Collection>
								<Record Type="UI.ChartDimensionAttributeType">
									<PropertyValue Property="Dimension" PropertyPath="Name"/>
								</Record>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
			</Annotations>
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks for the example Tobias however the above looks like you've used the older version template sap.ovp.cards.charts.donut since you don't have the annotation: <PropertyValue Property="ChartType" EnumMember="UI.ChartType/Donut"/> which I believe would be required if using the sap.ovp.cards.charts.analytical template (which is what WebIDE puts in if you add a analytical card now days).

Is that right (e.g. I have donut working fine using the old method like this)?

0
avatar image
Former Member May 12, 2017 at 01:40 PM
0

Hi Guys,

I have a slighty different problem with SmartChart Control. I used SEGW to add the annotations mentioned above (vocabulary based odata project):

As you can see the property "ChartType" was generated as "Column". I have chosen that value in the corresponding DDLB in SEGW. Nevertheless, the chart is not working because it expects "com.sap.vocabularies.UI.v1.ChartType/Column" instead of just "Column". When I add this term using code in the MPC_EXT class using "com.sap.vocabularies.UI.v1.ChartType/Column" the Smart Chart works fine. Does anybody know why it doesn't work with Standard code?

Regards

Tobias


Show 2 Share
10 |10000 characters needed characters left characters exceeded

Sorry Tobias - I could never get vocabulary SEGW working the way I needed it - Figured it was based on a version of annotations that would not keep up with the changes required by OVP so it's just the annotation editor in WebIDE, or possibly CDS annotated views you're stuck with...

Cheers,

Matt

0
Former Member

Hi Matt,

the funny thing is that I got it working when adding the annotation in the code in MPC_EXT class. I just think this is not the way it should work. When SAP offers a vocabulary builder in SEGW I would expect that the result works with their smart controls. I just don't know why vocabulary builder does not add the "com.sap.vocabularies.UI.v1.ChartType" where its needed...

In your example it's actually "<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Donut"/>" whereby "UI" is the alias for "com.sap.vocabularies.UI.v1". Really strange....

Regards

Tobias

0
Ozlem Seker Mar 09 at 12:43 PM
0

Hi,

I do this example but chart not display in analytical list page, page is waiting . Help me , please..

Regards,

Özlem.

Share
10 |10000 characters needed characters left characters exceeded