on 02-12-2016 2:45 PM
Hi all,
I'm creating an Viz Chart from oModal service, the service is delivering data as (odata):
There are more than 140 entries within this list.
// 1. Get the id of the VizFrame
var oVizFrame = this._getVizFrame(Q1_FREIGABE_CHART);
// 2. Create a JSON Model and set the data
var oModelT = oModel;//this._getOModel();
// 3. Create Viz dataset to feed to the data to the graph
var oDataset = new sap.viz.ui5.data.FlattenedDataset({
dimensions: [{
name: "Zeit",
value: "{ZeitVon}"
}],
measures: [{
name: "Online",
value: "{Bis30}"
}, {
name: "Offline",
value: "{Bis60}"
}],
data: {
path: "/EtDbDatenQ1AnzSet"
}
});
oVizFrame.setDataset(oDataset);
oVizFrame.setModel(oModelT);
oVizFrame.setVizType("line");
// 4. Set Viz properties
oVizFrame.setVizProperties({
general: {
layout: {
padding: 0.04
}
},
valueAxis: {
title: {
visible: true,
text: "Anzahl"
}
},
categoryAxis: {
title: {
visible: true,
text: "Zeitraum"
}
},
plotArea: {
colorPalette: d3.scale.category20().range()
},
title: {
visible: false,
text: "Auswertung Freigabeprozess"
}
});
var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
"uid": "valueAxis",
"type": "Measure",
"values": ["Online", "Offline"]
});
var feedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
"uid": "categoryAxis",
"type": "Dimension",
"values": ["Zeit"]
});
oVizFrame.addFeed(feedValueAxis);
oVizFrame.addFeed(feedCategoryAxis);
Running the application, it only shows the last entry!
Any idea why this is happen? While using an local created jsonModel it works... only with the original data from the server, as shown, it doesnt workss...
Thanks!
Solved it, transforming the oModel to JSONModel, does the job for me:
- oModel.read("/EtDbDatenQ3Set", undefined, undefined, true, function(oData, response) {
- var oModelJson = new JSONModel();
- oModelJson.setData(oData);
- ...
Afterwards all the data could be seen in viz chart.
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.