Search code examples
svgsapui5

sap VizFrame fireSelectData is not fireing


I have a bar chart written with vizframe and i want to call the fireSelectData function with the following parameter:

var oSelection = {
  data: [{
     target: $('.v-datapoint')[29],
     data: [{
        ctx: {
           path: {
              mg: 0,
              mi: 0,
              dii_a1: 0,
              dii_a2: 0 
           },
           val: 82.2      
        } 
     }]
   }],
   name: "selectData"
}
var frame = this.getView().byId('vizFrameId')
frame.fireSelectData(oSelection)

where $('.v-datapoint')[29] is the <g> svg tag and 28.2 is the value of a column. I'm not sure if these are the correct parameters for the object.

Which is really not clear for me is the path. Which value should be there for mg, mi, dii_a1 and dii_a2?


Solution

  • if you want to select specific values you can use the vizframe's vizSelection function.

    oVizFrame.vizSelection([{data : dataPoint}], {clearSelection : true});
    

    the first parameter is an array of datapoints wich are in the model of the vizframe. You can get those objects with oVizFrame.getModel().getProperty('/yourProperty')

    if you set clearSelection: true the previous selection will be cleared.