Hello all,
I have the following code and the vizframe it's not being displayed
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>test</title>
<script id="sap-ui-bootstrap" type="text/javascript"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.ui.ux3,sap.viz,sap.m"></script>
<script>
var page = new sap.m.Page("page", {
title: "Donut chart"
});
// VizFrame
var oVizFrame = new sap.viz.ui5.controls.VizFrame();
// JSON Model
var oModel = new sap.ui.model.json.JSONModel();
var data = {
"General" : [
{
"Status": "Status A",
"Value": "10"
}, {
"Status": "Status B",
"Value": "2"
}, {
"Status": "Status C",
"Value": "5"
}, {
"Status": "Status D",
"Value": "7"
}, {
"Status": "Status E",
"Value": "3"
}]
};
oModel.setData(data);
// 3. Create Viz dataset to feed to the data to the graph
var oDataset = new sap.viz.ui5.data.FlattenedDataset({
dimensions : [{
name : "Year",
value : "{Year}"
}],
measures : [{
name : "Population",
value : "{Value}"
}],
data : {
path : "/General"
}
});
oVizFrame.setDataset(oDataset);
oVizFrame.setModel(oModel);
oVizFrame.setVizType("donut");
var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
"uid": "valueAxis",
"type": "Measure",
"values": ["Population"]
}),
feedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
"uid": "categoryAxis",
"type": "Dimension",
"values": ["Year"]
});
oVizFrame.addFeed(feedValueAxis);
oVizFrame.addFeed(feedCategoryAxis);
var flexBox = sap.m.FlexBox();
flexBox.addItem(oVizFrame);
page.addContent(flexBox);
page.placeAt("content");
</script>
</head>
<body class="sapUiBody">
<div id="content"></div>
</body>
</html>
The result on browser is a blank page.