cancel
Showing results for 
Search instead for 
Did you mean: 

Viz charts gives error: [50017] - Invalid data binding

d060155
Employee
Employee
0 Kudos

Hi,

I am trying to create a viz chart with a local JSON model, I use a random strucutre generated, but I am unable to visualize the chart, the array is being filled properly.

[50017] - Invalid data binding

		onInit: function () {
			this.buildJSON();
			this.buildDataSet();
		},
		buildJSON: function () {
			var data = {};
			for (var i = 0; i < 500; i++) {
				data.mess = this.getRandomInt(100);
				data.count = this.getRandomInt(200);
				data.fix1 = this.getRandomInt(5000);
				data.fix2 = this.getRandomInt(9000);
				data.fix3 = this.getRandomInt(5000);
				dataArr.push(data);
				data = {};
			}
		},
		buildDataSet: function () {
			var dataset = new FlattenedDataset();
			var datasetData = new sap.ui.model.json.JSONModel(dataArr);
			this.getOwnerComponent().setModel(datasetData, "datasetData");
			dataset.bindData("datasetData>/",null,null,[]);
			var measure = new MeasureDefinition();
			measure.setName("fix1");
			measure.setValue("datasetData>fix1");
			dataset.addMeasure(measure);
			var measure2 = new MeasureDefinition();
			measure2.setName("fix2");
			measure2.setValue("datasetData>fix2");
			dataset.addMeasure(measure2);
			var dimension = new DimensionDefinition();
			dimension.setName("mess");
			dimension.setValue("datasetData>mess");
			dataset.addDimension(dimension);
			this.byId("idVizFrame").setModel(datasetData);
			this.byId("idVizFrame").setDataset(dataset);
		},
		getRandomInt: function (max) {
			return Math.floor(Math.random() * Math.floor(max));
		}

the HTML view for the viz chart is declared as follows:

	<viz:VizFrame id="idVizFrame" uiConfig="{applicationSet:'fiori'}" height='100%' width="100%" vizType='column'></viz:VizFrame>

Please assist.

Accepted Solutions (0)

Answers (0)