
I was working on the same demo I talked about in my last blog Gauges in SAPUI5 and as a tabular visualization for KPIs for multiple plants, we used a table with traffic light icons : Green, Red and Yellow to show the status of the KPIs. It somehow looked liked this :
Now when we demoed it to the client they were very clear about their needs. "It either shows a value with the traffic light or it is of just no use to us." Coming to think of it, a colored traffic light only represents a range of values and not any value in particular and this got us thinking about how we could best display the same using SAPUI5.
We decided that displaying the number within the circle could go a long way to meet the customer's needs and thus decided to create a simple and basic custom control for the same. It's called ColorCircle and the source code for the same can be downloaded from here. How does it look ? Somewhat like this :
The circles are generated using CSS and have been done with the help of Jose Vargas' Responsive CSS Circles blog.
The different properties of the custom control are as follows :
The custom control can be used in a column in a SAPUI5 Table Column thus :
var oColumn3 = new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "KPI 2"}),
template : new com.fujitsu.custom.ColorCircle({size:"50%"}).bindProperty("value", "KPI2"),
width: "13%"
});
oTable.addColumn(oColumn3);
That's it ! Your shiny new Traffic Light with values are ready :smile:
If you would want to create your own Custom Controls using SAPUI5, read here the documentation here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |