Skip to Content

SAPUI5 - Problem with VizFrame Treemap

Hello for some reason my implemented treemap does not get drawn.

I cant resolve this error by myself since i dont even get an error message.

This is how i retrieve my data:

self = this;
var dataPath = "/xsodata/getPortfolio.xsodata";
var dataModel = new sap.ui.model.json.JSONModel(dataPath + "/portfolioSet");
	dataModel.attachRequestCompleted(function () {
		var oVizFrame = self.getView().byId("idVizFrame");
		oVizFrame.setModel(dataModel);
	});

I have uploaded a picture of the model below.

<viz:VizFrame id="idVizFrame" height="100%" width="100%" vizType="treemap">
	<viz:dataset>
	    <viz.data:FlattenedDataset data="{/d/results}">
		<viz.data:dimensions>
		    <viz.data:DimensionDefinition name="DEPARTMENT" value="{DEPARTMENT}"/>
          	    <viz.data:DimensionDefinition name="AISLE" value="{AISLE}"/>
		 </viz.data:dimensions>
	         <viz.data:measures>
		     <viz.data:MeasureDefinition name="ANZAHL_PRODUCTS" value="{ANZAHL_PRODUCTS}"/>
		     <viz.data:MeasureDefinition name="ANZAHL_ORDERS" value="{ANZAHL_ORDERS}"/>
	          </viz.data:measures>
	        </viz.data:FlattenedDataset>
	  </viz:dataset>
          <viz:feeds>
		 <viz.feeds:FeedItem uid="color" type="Measure" values="ANZAHL_PRODUCTS"/>
		 <viz.feeds:FeedItem uid="weight" type="Measure" values="ANZAHL_ORDERS"/>
		 <viz.feeds:FeedItem uid="title" type="Dimension" values="DEPARTMENT"/>
		 <viz.feeds:FeedItem uid="title" type="Dimension" values="AISLE"/>
	 </viz:feeds>
</viz:VizFrame>

Sample of the xsodata:

{"d":{"results":[{"__metadata":{"uri":"https://hxehost:51026/xsodata/getportfolio.xsodata/portfolioSet('alcohol')","type":"default.portfolioSetType"},"ANZAHL_PRODUCTS":385,"ANZAHL_ORDERS":48657,"DEPARTMENT":"alcohol","AISLE":"beers coolers"},{"__metadata":{"uri":"https://hxehost:51026/xsodata/getportfolio.xsodata/portfolioSet('alcohol')","type":"default.portfolioSetType"},"ANZAHL_PRODUCTS":95,"ANZAHL_ORDERS":11198,"DEPARTMENT":"alcohol","AISLE":"specialty wines champagnes"},{"__metadata":{"uri":"https://hxehost:51026/xsodata/getportfolio.xsodata/portfolioSet('alcohol')","type":"default.portfolioSetType"},"ANZAHL_PRODUCTS":232,"ANZAHL_ORDERS":35181,"DEPARTMENT":"alcohol","AISLE":"red wines"},{"__metadata":{"uri":"https://hxehost:51026/xsodata/getportfolio.xsodata/portfolioSet('alcohol')","type":"default.portfolioSetType"},"ANZAHL_PRODUCTS":195,"ANZAHL_ORDERS":28102,"DEPARTMENT":"alcohol","AISLE":"spirits"}

any help would be appreciated

model.png (54.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jun 28 at 09:30 AM

    Found the problem here: Since i run the chart inside a icon tab bar, it was just too big for the tab... I have deleted the height and width attribute and its working now

    Add a comment
    10|10000 characters needed characters exceeded