title: Pie chart in sapui5
body: <p>I have a dropdown in which i have dropdown values as Zone and State.
  Now when i select Zone from the dropdown then iam displaying a pie chart with zone values and on select of pie chart section
  iam displaying only the selected zone values in a table.</p>
  
  <p>(for example if i select south section from the pie chart then only the south zone records will be displayed in table).</p>
  
  <p>That i have done.</p>
  
  <p>But  when i select the State from the dropdown the pie chart with state values is displaying but on click of pie chart section the records are not displaying in the table.</p>
  
  <p>So far i have used these code............</p>
  
  <pre class="lang-js prettyprint-override"><code>var oEvDataSet = new sap.viz.ui5.data.FlattenedDataset("EV_REPORT_DATASET", {
  
      dimensions: [{
          name: "ZONE",
          axis: 1,
          value: "{Key}"
      }],
  
      measures: [{
  
          name: "NUMBER",
          value: "{Number}"
      }],
  
      data: {
  
          path: "EVENTREPORT&gt;/ZONE"
              //path: "EVENTREPORT&gt;/Category"
  
      }
  
  });
  
  var line = new sap.viz.ui5.Pie({
  
      width: "60%",
      height: "500px",
      dataset: oEvDataSet
  
  });
  
  
  var fSelectionChanged = function(oEvent) {
      var data = this.selection();
      // var country,dso;
      var dataFilter = [];
      for (i in data) {
          var zone = data[i].data.ZONE;
          //var state = data[i].data.STATE;
          // state = data[i].data.STATE;
          dataFilter.push(new sap.ui.model.Filter("ZONE", "EQ", zone));
  
          //dataFilter.push(new sap.ui.model.Filter("STATE","EQ",state));
      }
      for (i in eventReportAllFilter) {
          dataFilter.push(eventReportAllFilter[i]);
  
          // dataFilter.push(new sap.ui.model.Filter("STATE","EQ",state));
      }
  
      //dataFilter.push(eventReportAllFilter);
      Ev_oTable_AllVenues.bindRows('AM_EventList&gt;/eventlist', oERZoneSorter, dataFilter);
  };
  
  line.attachSelectData(fSelectionChanged);
  line.attachDeselectData(fSelectionChanged);
  line.attachInitialized(function() {});
  oER_VerLayout.addContent(line);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/NvmFb.png" alt="Pie Chart"></p>
  
  <p>U can also see in the image.</p>
  
  <p>In the image if i select dropdown value as state the pie chart is displaying but on select of pie chart section the values are not displaying in the table.</p>
  
  <p>How can i do this..??</p>
  
  <p>Please help me on this.</p>
  
  <p>Thanks
  Sathish</p>