title: SAPUI5: Showing pie chart or Bar chart using OData service from HANA DB
body: <p>I am working on SAP HANA Development project where I need to develop an UI application using SAPUI5 and Odata service.</p>
  
  <p>I need a help on getting the data from HANA table and display in the Pie or Bar Chart.
  I am getting the data to a table(oTable) using odata service but not able to display it in the Pie Chart. </p>
  
  <p>Please find below the code snippet:</p>
  
  <pre><code>{
  var oModel = sap.ui.model.odata.ODataModel('link of the .xsodata' false);
  var oTable = new sap.ui.table.Table({tableId: "tableID", visibleRowCount: 10}); 
  oTable.setTitle("Transactions"); 
  oTable.setModel(oModel);
  oTable.bindRows('/Transactions');
  
  var dataset = new sap.service.visualization.dataset.SimpleDMDataset();
  dataset.setDataTable(oTable);
  
  var pie = new sap.service.visualization.chart.Pie("myPie", {
      width: "700px",
      height: "400px",
      allDeSelectable: true,
      legendFirst: true,
      selectionMode: 'single',
      legendDirection: 'right',
      title: 'Transactions',
      titleHorizontalAlign: 'center',
      subTitle: 'Q1 - 2012',
      subTitleHorizontalAlign: 'center',
      showTitle: true,
      defaultSelectedSliceIndexes: [5],
      legendFormatString: ['0.00%'],
      tooltipTextFormatString: ['0.00%'],
      tooltipMainValueFormatString: ['#,##0'],
      tooltipSubValueFormatString: ['0.00%'],
      showLegend: true,
      pieType: 'pie',
      dataset: dataset
  });
  
  pie.placeAt("uiAreaForMyControls");
  }
  </code></pre>
  
  <p>Please help me in getting the Pie chart displayed with the data as I am new and in learning phase.</p>