Hi ,
Use this.
- if(pageId=="Detail") {
- // // Using OData model to connect against a real service
- var url = "/sap/opu/odata/sap/ZDUEITEMS_SRV";
- //myPath = path;
- var oModelDetail = new sap.ui.model.odata.ODataModel(url, true);
- oModelDetail.read(context.getPath(), null, {"$expand":"DueAmountsSet"}, false, function(oData, oResponse){
- // create JSON model
- var oODataJSONModel = new sap.ui.model.json.JSONModel();
- // set the odata JSON as data of JSON model
- oODataJSONModel.setData(oData);
- // store the model
- sap.ui.getCore().setModel(oODataJSONModel, "MyJSONModel");
- var chart = page.byId("dueDateChart");
- chart.setModel(oODataJSONModel);
- }, function(){
- alert("Read failed");
- }
- );
- }
- In addition we changed our dataset:
var dataset = new sap.viz.ui5.data.FlattenedDataset({
dimensions : [ {
axis : 1,
name : 'NoOfDays',
value : "{NoOfDays}"
} ],
measures : [ {
name : 'DueAmount',
value : '{DueAmount}',
}],
data : {
path : "/DueAmountsSet/results"
}
});
- this may helpflu to you.