Skip to Content
0
Former Member
Feb 12, 2016 at 02:45 PM

Viz Chart only shows last entry of Model

82 Views

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!

Attachments

odata.PNG (81.9 kB)
last_entry.PNG (12.5 kB)