{
"Data": [{
"Rollno": "1234",
"Name": "Sreelekha",
"Gender": "Female",
"size": "S",
"percentage": 90.2,
"option": "Good",
"total": 100,
"colorPalette": ""
}, {
"Rollno": "2345",
"Name": "Sindhu",
"Gender": "Female",
"size": "S",
"percentage": 75,
"option": "Critical",
"total": 100,
"colorPalette": ""
}, {
"Rollno": "3456",
"Name": "Sunil",
"Gender": "Male",
"size": "L",
"percentage": 65.7,
"option": "Error",
"total": 100,
"colorPalette": ""
}, {
"Rollno": "4567",
"Name": "Swathi",
"Gender": "Female",
"size": "L",
"percentage": 45.5,
"option": "Neutral",
"total": 100,
"colorPalette": ""
}]
}
<mvc:View controllerName="com.HarveyBallMicroChartHarveyBallMicroChart.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:mvc="sap.ui.core.mvc" xmlns:micro="sap.suite.ui.microchart" displayBlock="true" xmlns="sap.m">
<App>
<pages>
<Page title="Harvey Ball Micro Chart">
<content>
<Panel>
<Table items="{ path: 'dataModel>/Data'}">
<columns>
<Column>
<Label text="Roll no" design="Bold"></Label>
</Column>
<Column>
<Label text="Name" design="Bold"></Label>
</Column>
<Column>
<Label text="Gender" design="Bold"></Label>
</Column>
<Column>
<Label text="Percentage" design="Bold"></Label>
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{dataModel>Rollno}"></Text>
<Text text="{dataModel>Name}"></Text>
<Text text="{dataModel>Gender}"></Text>
<micro:HarveyBallMicroChart size="{dataModel>size}" total="{dataModel>total}" colorPalette="{dataModel>colorPalette}" totalScale="%"
showTotal="true" showFractions="true">
<micro:items>
<micro:HarveyBallMicroChartItem fraction="{dataModel>percentage}" color="{dataModel>option}" fractionScale="%"/>
</micro:items>
</micro:HarveyBallMicroChart>
</cells>
</ColumnListItem>
</items>
</Table>
</Panel>
</content>
</Page>
</pages>
</App>
</mvc:View>
onInit: function() {
var dataModel = new sap.ui.model.json.JSONModel("./model/Data.json");
this.getView().setModel(dataModel, "dataModel");
}
{
"Rollno": "5678",
"Name": "swetha",
"Gender": "Female",
"size": "L",
"percentage": 30.1,
"option": "",
"total": 100,
"colorPalette": "#ED4A7B"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
10 | |
9 | |
7 | |
4 | |
4 | |
3 | |
3 | |
2 | |
2 |