Skip to Content
avatar image
Former Member

VizFrame charts - Store additional data

Hi experts,

We are using viz charts through the VizFrame controls. It is possible to create a dataset (dimension and measures) and put feeds into the chart controls.

Current state:

E.g. for bubble charts we can provide the feeds for regionShape, regionColor, bubbleHeight, bubbleWidth, secondaryValues and primaryValues.

After clicking a bubble, the "selectData" event of the VizFrame delivers these feed values as expected.


Requirement:


What we really need is to link the selected bubble in the "selectData" event to the respective line in the model or at least in the dataset. E.g. we should be able to store and receive an id or row index as feed value which enables us to connect the bubble with a concrete row in the data model.


Also, this "technical id" should not be shown in the bubble chart.


Findings

I found an example connecting to the actual chart elements path... but the example was for NAKED Viz charts. The VizFrame event does not seem to contain the information "ctx.path".


Here the example I found and which does not work with VizFrame

              selectData : function(e) {

                // event data as provided by the VIZ library

                var aSelectData = e.getParameter("data");

                // the FlattenedDataset used by this chart

                var oDataset = this.getDataset();

                for(var i=0; i<aSelectData.length; i++) {

                  var oDataPoint = aSelectData[i];

                  for(var j=0; j<oDataPoint.data.length; j++) {

                    var oPath = oDataPoint.data[j].ctx.path;

                    var oContext = oDataset.findContext(oPath);

                    panel.setBindingContext(oContext);

                  }

                }

              }

I hope somone had seen this problem before and can help me out with this issue.

regards

Manuel

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 11, 2015 at 12:16 AM

    hi

    you can try the below

    onSelectchartdata: function(oEvent){

      var oChart = this.getView().byId("idrevenue");

      var dataRecordIndex = oEvent.getParameter("data")[0].data._context_row_number;

      var oSelectedData = oChart.getModel().getProperty("/Sales/"+dataRecordIndex);

      // console.log(oSelectedData);

      console.log(oSelectedData.Year)

      console.log(oSelectedData.Actual);

    find attached the working model zip file... unzip and check the working model .(pl. remove .txt extension and unzip)

    regards


    Add comment
    10|10000 characters needed characters exceeded