Skip to Content
0
Former Member
Apr 07, 2016 at 06:30 AM

Uncaught TypeError: Cannot read property 'setDataset' of undefined

609 Views

Hello Experts,

I am getting some Unknown error 😔

Can any one help me to solve this ??

here is my view code:

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc"

xmlns="sap.m" controllerName="demovizframe.V_chart"

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

xmlns:html="http://www.w3.org/1999/xhtml">

<Page title="Title">

<content>

<viz:VizFrame xmlns="sap.viz" id="idcolumn" >

</viz:VizFrame>

</content>

</Page>

</core:View>

my controller code :

var url2 ="http://xx.xx.xx.xx:8000/AC_ANALYTICS/Power111.xsodata/SENSOR_DETAILS1?$select=SO_TEXT_DT_MM_YYYY,HOUR,ATM_TEMPERATURE&$filter=SO_TEXT_DT_MM_YYYY eq '"+cval+"' &$format=json";

var salesModel2 = new sap.ui.model.json.JSONModel();

salesModel2.loadData(url2);

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

var oDataset = new sap.viz.ui5.data.FlattenedDataset({

dimensions : [{

name : 'HOUR',

value : "{HOUR}"}],

measures : [{

name : 'TEMP',

value : '{ATM_TEMPERATURE}'} ],

data : {

path : "/d/results"

}

});

oVizFrame.setDataset(oDataset);

oVizFrame.setModel(salesModel2);

oVizFrame.setVizType('line');

oVizFrame.setVizProperties({

plotArea: {

colorPalette : d3.scale.category20().range()

}});

var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({

'uid': "valueAxis",

'type': "Measure",

'values': ["TEMP"]

}),

feedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({

'uid': "categoryAxis",

'type': "Dimension",

'values': ["HOUR"]

});

oVizFrame.addFeed(feedValueAxis);

oVizFrame.addFeed(feedCategoryAxis);

Thanks in Advance,

Bharath

Attachments

setdata.png (37.2 kB)