cancel
Showing results for 
Search instead for 
Did you mean: 

VIZ Frame / Bar diagramm not working

christoph_nagl
Participant
0 Kudos

Hi All,

I have the case that bar diagram is not printed.

View part of the diagramm:

<viz:VizFrame id="idVizFrameBar" uiConfig="{applicationSet: 'fiori'}"

  vizType="info/bar">

  </viz:VizFrame>

Controller part of the diagram:

var oVizFrame = this.getView().byId("idVizFrameBar");

  sap.ui.getCore().setModel(oModel);

  var oDataset = new sap.viz.ui5.data.FlattenedDataset({

  dimensions : [ {

  name : "Bezeichnung",

  value : "{BEZEICHNUNG}"

  } ],

  measures : [ {

  name : "Anzahl",

  value : "{ANZAHL}"

  } ],

  data : "{/OBJECTSet}"

  });

  oVizFrame.setDataset(oDataset);

the oModel is created earlier in code and is working because binding in other components is working.

In the sap gui no data is printed...

Thanks for information.

Best regards,

Christoph

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

have you found a solution? We connect a line graph to an OData service, with the model bound to the view, not to the VizFrame, because we also think that this should be enough, because in the network tab I can see the request to fetch the data, but the graph is showing the error message:


"Anlegen des Diagramms fehlgeschlagen:[50053] - Unvollständige Dimensionsbindung".

I would like to know though, if that means my graph definition is wrong or if the data coming from the OData service is not suitable. It's even worse, because we have a date for the x-axis to print integer values to the y axis. Is that supported, is it not - we don't know because of the lacking documentation.

Kind regards,

Michael

PMarti
Active Participant
0 Kudos

Hi Christoph, where do you read data? you need do something like that to retrieve data:


sap.ui.getCore().getModel().read("/function", { ...} )

In your code, you are not calling de function to retrieve data, so the model is empty.

You can see more information about that in: SAPUI5 SDK - Demo Kit

christoph_nagl
Participant
0 Kudos

Hi Paul,

I think a read call is not necessary because the method GET_ENTITY_SET of the service is called. This method I think will be called automatically if there is a binding defined for the path!

I add this call too but nothing changed.

Page is empty.. 😞

Thanks..

Best regards,

Christoph

christoph_nagl
Participant
0 Kudos

Hi all,

I think the problem is the model - the omodel and the corresponding details.

With the example of the json model it works.

How must be the model defined in the SEGW transaction that it works with the bar chart.

Thanks for information.

Best regards,

Christoph

christoph_nagl
Participant
0 Kudos

Hi all,

is it possible to check some trace of the diagramm..

Still the screen is empty - no error message nothing...

Thanks for your help.


Best regards,

Christoph

PMarti
Active Participant
0 Kudos

Hi Christoph, surely you have another model at level of view on you declare the VizFrame control. If you do not need share the oModel of your code with other controls, you can solve it like this:


sap.ui.getCore().byId('idVizFrameBar').setModel(oModel);

christoph_nagl
Participant
0 Kudos

Hi,

I have added the following statement but the same result.

Empty page 😞

// diagramm initialisieren

  var oVizFrame = this.getView().byId("idVizFrameBar");

  sap.ui.getCore().setModel(oModel);

  var oDataset = new sap.viz.ui5.data.FlattenedDataset({

  dimensions : [ {

  name : "Bezeichnungen",

  value : "{BEZEICHNUNG}"

  } ],

  measures : [ {

  name : "Anzahl",

  value : "{ANZAHL}"

  } ],

  data : "{/OBJECTSet}"

  });

  oVizFrame.setModel(oModel);

  oVizFrame.setDataset(oDataset);

In the view I have added simple this statement.

<viz:VizFrame id="idVizFrameBar" uiConfig="{applicationSet:'fiori'}" vizType="info/bar" width="900px" height="700px"></viz:VizFrame>

Best regards,

Christoph

PMarti
Active Participant
0 Kudos

Hi Christoph,

Do you have something like that?


oModel.setData({

             OBJECTSet: modelDataObject

});

or (in case of JSONModel)


oModel = new sap.ui.model.json.JSONModel({

              OBJECTSet: modelDataObject

});

Can you show how put the data in your model?

christoph_nagl
Participant
0 Kudos

Hi,

here is the model definition - I use the model also for a table and some other components.

var oModel = new sap.ui.model.odata.ODataModel(

  "/sap/opu/odata/CUSTOMER/TEST_SRV");

Best regards,

Christoph