cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 problems with Pie Chart

Former Member
0 Kudos

Hello!

I have problems with VizFrame Pie Chart. First of all, I don't understand why

<viz:VizFrame> and <viz:feeds> don't work. My programm does't want to work at all after that. Secondly, I have one problem with definitions. I have connection with my local database. In my database I have {Status01}, {Status02}, {Status03} etc. I want to get a Pie Chart in % for every status. For example, status "Offen" 20%, "Bearbeitung" 30%, "Abgeschlossen" 5% etc. But I don't have one set for status as for example "Country" and in this set all countries. That's why right now my Pie Chart looks like this. And % I have also like this {Status01Perc}, {Status02Perc} etc. How can I my information about status together connecting? I understood that I can make only one DimensionDefinition...

One more question, why not all charts and entities in explorer work in Web IDE? Or the problem is that I use local installation of Web IDE?

Thank you in advance!:)

I send you code und scrins.

My pie chart.

    <viz:ui5.Pie>
                                <viz:dataset>
                                    <viz:ui5.data.FlattenedDataset data="{/Stats}">
                                        <viz:dimensions>
                                            <viz:ui5.data.DimensionDefinition axis="1" name="{Status01Text}" value="{Status01}"/>
                                        </viz:dimensions>
                                        <viz:measures>
                                            <viz:ui5.data.MeasureDefinition name="Anteil %" value="{Status01Perc}"/>
                                        </viz:measures>
                                    </viz:ui5.data.FlattenedDataset>
                                </viz:dataset>
                                <!-- sap.viz.ui5.data.Dataset -->
                            </viz:ui5.Pie>

matadata.xml

<?xml version="1.0" encoding="UTF-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
    <edmx:DataServices m:DataServiceVersion="2.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <Schema Namespace="UI5STAT1_SRV" xml:lang="de" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
            <EntityType Name="Stat" sap:content-version="1" xmlns:sap="http://www.sap.com/Protocols/SAPData">
                <Key>
                    <PropertyRef Name="Line"/>
                </Key>
                <Property Name="Layout" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Planungslayout"/>
                <Property Name="Obart" Type="Edm.String" Nullable="false" MaxLength="2" sap:label="Objektart"/>
                <Property Name="Kokrs" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="KostRechKreis"/>
                <Property Name="Line" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Zähler"/>
                <Property Name="Pjahr" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Planungsjahr"/>
                <Property Name="Version" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="Version"/>
                <Property Name="Status01" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="0" sap:label="Aktiv (St >= 3)"/>
                <Property Name="Status02" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="0" sap:label="Aktiv (St >= 3)"/>
                <Property Name="Status03" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="0" sap:label="Aktiv (St >= 3)"/>
                <Property Name="Status04" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="0" sap:label="Aktiv (St >= 3)"/>
                <Property Name="Status05" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="0" sap:label="Aktiv (St >= 3)"/>
                <Property Name="Status06" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="0" sap:label="Aktiv (St >= 3)"/>
                <Property Name="Status01Perc" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="2"/>
                <Property Name="Status02Perc" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="2"/>
                <Property Name="Status03Perc" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="2"/>
                <Property Name="Status04Perc" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="2"/>
                <Property Name="Status05Perc" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="2"/>
                <Property Name="Status06Perc" Type="Edm.Decimal" Nullable="false" Precision="6" Scale="2"/>
                <Property Name="LayoutText" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Langtext"/>
                <Property Name="Status01Text" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Bezeichnung"/>
                <Property Name="Status02Text" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Bezeichnung"/>
                <Property Name="Status03Text" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Bezeichnung"/>
                <Property Name="Status04Text" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Bezeichnung"/>
                <Property Name="Status05Text" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Bezeichnung"/>
                <Property Name="Status06Text" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Bezeichnung"/>
            </EntityType>
            <EntityContainer Name="UI5STAT1_SRV" m:IsDefaultEntityContainer="true">
                <EntitySet Name="Stats" EntityType="UI5STAT1_SRV.Stat" sap:content-version="1" xmlns:sap="http://www.sap.com/Protocols/SAPData"/>
                </EntityContainer>
                <atom:link rel="self" href="http://192.168.10.59:8080/webidedispatcher/destinations/v01/sap/opu/odata/kernc/UI5STAT1_SRV/$metadata" xmlns:atom="http://www.w3.org/2005/Atom"/>
                    <atom:link rel="latest-version" href="http://192.168.10.59:8080/webidedispatcher/destinations/v01/sap/opu/odata/kernc/UI5STAT1_SRV/$metadata" xmlns:atom="http://www.w3.org/2005/Atom"/>
                    </Schema>
                </edmx:DataServices>
            </edmx:Edmx>

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you for your answer! But I suppose you understood me a little bit wrong. I have a connecton with OData. I want to get a Pie Chart with statuses "Offen", "Bearbeitung", "Abgeschlossen" etc. In meine Database I dont't have direkt infromation. I have Status 01, Status02 Status 03 etc. How can I group my data? Or can I have a few demension defention?

former_member196805
Contributor
0 Kudos

Please check this snippix https://jsfiddle.net/chapmanwong/Lma70p66/9/

You could use below property to define the datalabel

plotArea:{dataLabel:{type: "colorAndPercentage"}}