I am working on SAP HANA Development project where I need to develop an UI application using SAPUI5 and Odata service.
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.
Please find below the code snippet:
{
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");
}
Please help me in getting the Pie chart displayed with the data as I am new and in learning phase.

