i'm pretty sure my code is fine, but i get a square with "no data" as a result
in the controller on init:
onInit: function() { var oData = [{product:"computer" , value:"20"}, {product:"computer2" , value:"30"}, {product:"computer3" , value:"10"} ]; var oModel = new sap.ui.model.json.JSONModel(oData); this.getView().setModel(oModel); }
in my XML view:
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.ui.commons" controllerName="test_chart_xml.test" xmlns:html="http://www.w3.org/1999/xhtml"> <ui5.Bar xmlns="sap.viz" width="640px" height="480px"> <dataset> <ui5.data.FlattenedDataset xmlns="sap.viz"> <dimensions> <ui5.data.DimensionDefinition xmlns="sap.viz" axis="1" value="{product}" name="prouduct"> </ui5.data.DimensionDefinition> </dimensions> <measures> <!-- sap.viz.ui5.data.MeasureDefinition --> <ui5.data.MeasureDefinition xmlns="sap.viz" value="{value}" name="number of items"> </ui5.data.MeasureDefinition> </measures> <data path="/"> </data> </ui5.data.FlattenedDataset> </dataset> </ui5.Bar></core:View>
all of what i get is a 640px X 480px square with the text "no data" , it works fine in javascript......
I think the problem is that the binding info is not parsed correctly in the XML view...
this is a debug picture from a chart in JAVA-SCRIPT view:
this is a debug picture from a chart in XML view:
the data object is missing in the XML view