on 2013 Feb 07 6:54 PM
I was trying to reproduce a similar result if I substitute the Javascript Object Literal notation with Javascript methods and objects for a Pie chart. So I have this :
var dataset1 = new sap.viz.ui5.data.FlattenedDataset({
dimensions : [ {
axis : 1,
name : 'Product',
value : "{Material}"
} ],
measures : [ {
name : 'Quantity',
value : '{PercQuantity}'
} ],
data : {
path : "/Rowset/Row",
factory : function() {
}
}
});
And the corresponding code I wrote replacing the one above is :
dataset1 = new sap.viz.ui5.data.FlattenedDataset();
var dimObject = new sap.viz.ui5.data.DimensionDefinition();
dimObject.setAxis(1);
dimObject.setName("Product");
dimObject.setValue("{Material}");
dataset1.addDimension(dimObject);
var measObject = new sap.viz.ui5.data.MeasureDefinition();
measObject.setName("Quantity");
measObject.setValue("{PercQuantity}");
dataset1.addMeasure(measObject);
dataset1.bindData("/Rowset/Row", "");
Which seems to not work . Esp. it seems that UI5 fails to interpret this line for the data binding :
dimObject.setValue("{Material}"); & measObject.setValue("{PercQuantity}");
What exactly am I doing wrong ? What is the alternative if I want to do it not the JS Obj Literal notation way ?
Thanks so much
Request clarification before answering.
Hi Abesh,
think I have cracked this. You need to bind the property as follows.
dataset1 = new sap.viz.ui5.data.FlattenedDataset();
var dimObject = new sap.viz.ui5.data.DimensionDefinition();
dimObject.setAxis(1);
dimObject.setName("Product");
dimObject.bindProperty("value","Material"); /* Use this instead of setValue method */
dataset1.addDimension(dimObject);
var measObject = new sap.viz.ui5.data.MeasureDefinition();
measObject.setName("Quantity");
measObject.bindProperty("value","PercQuantity"); /* Use this instead of setValue method */
dataset1.addMeasure(measObject);
dataset1.bindData("/Rowset/Row", "");
Cheers
Graham Robbo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.