on 11-17-2014 1:31 PM
Uncaught [50005] - axisLabels : does not meet minimum or maximum number of feeds definition.
Below is the Code:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m,sap.viz"
data-sap-ui-theme="sap_bluecrystal">
</script>
<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
<script type="text/javascript">
var oModel =new sap.ui.model.json.JSONModel({
data:[
{product:"Car",country:"India",profit:"50"},
{product:"Car",country:"China",profit:"30"},
{product:"Car",country:"USA",profit:"40"},
{product:"Car",country:"Japan",profit:"35"},
{product:"Car",country:"Canada",profit:"55"},
{product:"Car",country:"Germany",profit:"65"}
]
});
sap.ui.getCore().setModel(oModel);
var dataset = new sap.viz.ui5.data.FlattenedDataset({
dimentions:[
{
axis:2,
name:"country",
value:"{country}"
},
{
axis : 2, name : 'Product', value : "{product}"
}],
measures:[{ name : 'Profit', value : '{profit}' }],
data : { path : "/data" }
});
new sap.viz.ui5.StackedColumn("oChart", {
width : "100%",
height : "200px",
title : {
visible : true,
text : 'Test Stacked Column Chart'
},
dataset : dataset
}).placeAt("content");
sap.ui.getCore().byId("oChart").setInteraction(
new sap.viz.ui5.types.controller.Interaction(
{
selectability : new sap.viz.ui5.types.controller.Interaction_selectability(
{
mode : sap.viz.ui5.types.controller.Interaction_selectability_mode.none
})
}));
sap.ui.getCore().byId("oChart").attachBrowserEvent("click",
chartClickHandler);
function chartClickHandler(oEvent) {
if (!$(oEvent.srcElement).closest('.v-m-xAxis').length)
return;
var xAxisLabel = $(
$(oEvent.srcElement).next('.viz-axis-label').children(
'text')).text();
new sap.ui.commons.Dialog({
title : xAxisLabel + " clicked"
}).open();
}
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
Found some errors in your code.
1. It's dimensions & not dimentions
2. There are two dimensions defined as axis : 2 ? Change the first one to axis : 1
Working snippet of your code .JS Bin - Collaborative JavaScript Debugging
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.