Hi
i have three files:
1. MO_SalesData.xsodata file which loaded successfully in web browser.
2. main1.html which contain current code:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons,sap.viz,sap.m"
data-sap-ui-theme="sap_goldreflection">
</script>
<!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
<script>
sap.ui.localResources("bi_system");
var view = sap.ui.view({id:"idmain1", viewName:"bi_system.main1", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
3. main1.view.js file which contain current code:
sap.ui.jsview("bi_system.main1", {
getControllerName : function() {
return "bi_system.main1";
},
createContent : function(oController) {
var oPage = new sap.m.Page("homePage", {
showNavButton : false,
showFooter : false
});
var dataset = new sap.viz.ui5.data.FlattenedDataset({
dimensions : [
{
axis : 1, // must be one for the x-axis, 2 for y-axis
name : 'COUNTRY', //Any name .. preferrably db column name
value : "{COUNTRY}" //database column that you get in while access .xodata
}],
measures : [ {
group : 1,
name : "QUANTITY",
value : "{QUANTITY}" // this is database count for the columb you chose
}],
data : {
path : '//../MO_SALESDATA', // this is your context that you define in your .xodata file
}
});
var pie = new sap.viz.ui5.Pie({
width : "100%",
height : "300px",
showLegend : false,
plotArea : {
'colorPalette' : d3.scale.category20().range()
},
title : {
visible :true,
text : 'Graph Name'
},
dataset : dataset
});
oPage.addContent(pie);
return oPage;
}
}
);
i tried to upload main1.html but i got empty results even though no errors appear in webpage: