Skip to Content
Mar 07, 2014 at 09:09 AM

sap.viz.ui5 charts: Warning/Alert (Limit) values


Hello Colleagues,

we are developing an application which contains a number of charts. Our data is retrieved via an OData service and currently our initial screen is as per the attached image writeOffChart1.

The code used to produce the chart looks like this:

//Data from OData Service for Chart display var oModel2 = new sap.ui.model.json.JSONModel(); var url2 = "/sap/opu/odata/sap/Z_WRITEOFF_001_SRV/wo_itemSet"; oModel2.loadData(url2,"",false); var dataset2 = new{

dimensions : [ {

axis : 1,

name : 'Abdat',

value : "{Abdat}"

} ],

measures : [ {

name : 'SumAmount',

value : '{SumAmount}',


data : {

path : "/d/results"



var chart = this.getView().byId('writeOffChart'); chart.setDataset(dataset2); chart.setModel(oModel2);

The requirement is to produce a screen as shown in the second attachment writeOffChart2.

Our questions are:

  • Is it possible to add 'alert/warning' lines to the chart? (Or do we need to use a different type of chart, say, Combination and generate the lines from a separate data-set)
  • Can the individual bars be coloured according to their status with respect to a pre-determined alert level (as shown in the second attachment)?
  • Is there a control which can be used to dynamically set the Warning and Alert levels, for example could a slider be used? Or is there a recommended way to achieve this?

We've looked thorough many examples and searched scn and read lots of documentation but we haven't found a particular example that is similar to ours.

I should also add that SAPUI5 and Fiori are relatively new topics for us, but any assistance would be gratefully received.

Kind regards,

Keith Sanderson


writeOffChart2.jpg (331.8 kB)
writeOffChart1.jpg (232.0 kB)