cancel
Showing results for 
Search instead for 
Did you mean: 

Size of Null error with VizFrame (type: PIE)

Former Member
0 Kudos

Hi,

Here is the code for the VizFrame(type pie) in XML:

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"  xmlns:viz.feeds="sap.viz.ui5.controls.common.feeds"

    xmlns:viz.data="sap.viz.ui5.data"    xmlns:viz="sap.viz.ui5.controls"

  controllerName="supplychain.dashboard.view.Main" xmlns:html="http://www.w3.org/1999/xhtml"  >

  <Page enableScrolling="false">

  <viz:VizFrame id="idVizFrame" uiConfig="{applicationSet:'fiori'}"

                height='100%' width="100%" vizType='pie'>

                <viz:dataset>

                    <viz.data:FlattenedDataset data="{/DelayRecord}">

                        <viz.data:dimensions>

                            <viz.data:DimensionDefinition name="Name"

                                value="{name}" />

                        </viz.data:dimensions>

                        <viz.data:measures>

                            <viz.data:MeasureDefinition name="Delay"

                                value="{delay}" />

                        </viz.data:measures>

                    </viz.data:FlattenedDataset>

                </viz:dataset>

                <viz:feeds>

                    <viz.feeds:FeedItem uid="size" type="Measure"

                        values="Delay" />

                    <viz.feeds:FeedItem uid="color" type="Dimension"

                        values="Name" />

                </viz:feeds>

            </viz:VizFrame>

  </Page>

</core:View>

Here is the model :

{

"DelayRecord": [

{

"name": "CSR",

"delay": 23

},

{

"name": "Planner",

"delay": 21

}

]

}

I am setting the model in the controller as follows:

var Model = new  sap.ui.model.json.JSONModel("model/dashboard.json");

  var oVizFrame = this.getView().byId("idVizFrame");

  oVizFrame.setModel(Model);

I receive the following error: Uncaught type error: size of null.

Can you please help me resolve this error?

Regards,

Anjana.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member196805
Contributor
0 Kudos

Anjana NB, if you must place vizFrame on a sap.m.Page, please ensure the parent of sap.m.Page has size defined. sap.m.Page doesn't accept size but will pick up the size of its' parent. Suggest you to add the page on sap.m.App.

Sai Vellanki, in your snippix, sap.m.App is defined as parent of sap.m.Page and also have MVC view height defined so pie chart can be shown. If you remove both sap.m.App and height of MVC view defined, height of content section of sap.m.Page will be 0.

saivellanki
Active Contributor
0 Kudos

Hi ,

Your code works fine for me: Plunker

Regards,

Sai.