Hi Priya,
Here I am adding code for your understanding which has done by me hope it might be helpful for you
here is the below code for your Application
Define your model Globally as
var model = new sap.ui.model.odata.ODATAModel(url);
createContent : function(oController) {
var oDataset = new sap.viz.ui5.data.FlattenedDataset('d1', {
dimensions:[
{
axis:1,
name:'country',
value:"{country}"
}],
measures:[
{
name:'revenue in billion dollars',
value:'{revenue}'
},
{
name:'population in cr',
value:'{population}'
}
],
data: {
path:"/modelData"
}
});
var ochart = new sap.viz.ui5.Bar('b1', {
width : "80%",
height : "400px",
plotArea : {
},
title : {
visible : true,
text : 'Profit and Revenue By Country'
},
dataset : oDataset
});
ochart.setModel(model);
ochart.placeAt('content');
}
});