Skip to Content

Representing Business data with SAPUI5 VIZ chart – some useful Tips and Tricks

The sap.viz charting library provides a set of flexible chart controls that allow to easily

representing business data in a feature rich, graphical manner.

Quick Coding to get a BAR Chart

(Probably most of you know how to build a basic chart. Do not worry this is just starting.

Something more is waiting for you. 🙂 )

var oModel = new sap.ui.model.xml.XMLModel(); 



var oDataset = new;

var DimensionList = new; (Y Axis)





var MeasureListActual = new;(X Axis)




var MeasureListPlan = new;(X Axis)





var oChartCompare = new sap.viz.ui5.Bar


                           id : “ChartCompare”,

                           width :”310px”,

                           height : “100px”,

                          dataset : oDataset



XML structure









We get Simple meaning less Bar Chart from above code 😕


  • I will add X axis.


var XAxis = oChartCompare.getXAxis();


  • Also Y Axis

var YAxis = oChartCompare.getYAxis();



  • “We don’t understand the meaning of green & blue color without legend” 😡


var ProdLegendYTD = 



  • Can you give me a tooltip please ?

var ProdTooltipYTD =




  1. But  /wp-content/uploads/2014/07/index_510734.png(My mind wants more) “3D round corner bar”



height : “100px”,







dataset : oDataset


  • My charts are not C/wp-content/uploads/2014/07/12_510501.pngL/wp-content/uploads/2014/07/12_510501.pngRFUL

var color1 = “#EAC117”;

var color2 = “#38ACEC”;

var color3 = “#838B83”;

var color4 = “#728C00”;


height : “100px”,


              drawingEffect: sap.viz.ui5.types.

Bar_drawingEffect.glossy,           isRoundCorner:true,                                            



dataset : oDataset



  • Please show me value on the top of bar, please….








                   positionPreference : true,

                   position : sap.viz.ui5.types. 



dataset : oDataset


  • Last one -comma separated value for better visibility





                     position : sap.viz.ui5.types.


                     formatString : [[“##,0”],[“en-US”]]


dataset : oDataset



All these very beautiful and useful features of Viz chart are the overnight reinvention/research by My KOLKATA SAP MII Team. Thanks to all of them, especially thanks to Ushinar Basu, Arnab Singha, Sushabhan Banerjee, Pratibha Singh & Sucharit Dutta.

Thanks Som Sarkar and Animesh Mondal for their guidance, where we get stuck.

Thanks Sudipta Mukherjee for his great ideas & guidance on charts to impress our client at first sight.

Thanks Dipankar Saha for always inspiring me to write this kind of blog. Hope this will help everyone.

You must be Logged on to comment or reply to a post.
  • Thnaks for the Tutorial, have any solutions to changing the default postion of the X and Y axis , by setting a value for thier position for instance in Highcharts I could do this

    yAxis: {

         plotLines: [{

             color: ‘#000000’,

                     width: 1,

                     value: 5


             labels: {

      enabled: false


    and achieve thisCapture.PNG

    Thanks for the suggestions

  • Hi is it possible to ever build a Bubble chart with the code below, What could I be missing

    sap.ui.jsview(“views.BubbleCoy”, { 

              /** Specifies the Controller belonging to this View.

              * In the case that it is not implemented, or that “null” is returned, this View does not have a Controller.

              * @memberOf views.Bubble


              getControllerName : function() { 

                        return null; 


              /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.

              * Since the Controller is given to this method, its event handlers can be attached right away.

              * @memberOf views.Companies


              createContent : function(oController) {



                        var mainCoyBubbleChart = new sap.viz.ui5.types.Bubble(“mainCoyBubbleChart”, {  

                                  width : “100%”, 

                                  height : “50%”, 

                                  line : {

                              //’colorPalette’ : d3.scale.category20().range()



                                  title : { 

                                            visible : true, 

                                            text : ‘Copmpany Aggregation’  



                                  xAxis: { 

                                      //title: { visible: true, text : “Friend Aggregation” },

                                      //scale: new sap.viz.ui5.types.Axis_scale({fixedRange:true, Value: 5, minValue: 0, maxValue: 12})



                                  dataset : topSalesDataset = new{ 

                                            // a Bar Chart requires exactly one dimension (x-axis) 

                                            dimensions : [ { 

                                                      axis : 1, // must be one for the x-axis, 2 for y-axis 

                                                      name : ‘Company’, 

                                                      value : “{Name}” 


                                            // it can show multiple measures, each results in a new set of bars 

                                            // in a new color 

                                            measures : [  




                                        name : ‘Business Value’, // ‘name’ is used as label in the Legend 

                                                  value : ‘{BusinessValue}’ // ‘value’ defines the binding for the 




                                            name : ‘Friend Value’, // ‘name’ is used as label in the Legend 

                                                      value : ‘{friendValue}’ // ‘value’ defines the binding for the 



                                            // ‘data’ is used to bind the whole data collection that is to be 

                                            // displayed in the chart 

                                            data : { 

                                                      path : “/” 





    //                    var YAxis = mainBubbleChart.getYAxis();

    //          YAxis.setVisible(true);



                        return mainCoyBubbleChart; 


  • Manali,

    Unless you are asking for clarification/correction of some part of the Document, please create a new Discussion marked as a Question.  The Comments section of a Blog (or Document) is not the right vehicle for asking questions as the results are not easily searchable.  Once your issue is solved, a Discussion with the solution (and marked with Correct Answer) makes the results visible to others experiencing a similar problem.  If a blog or document is related, put in a link.  Read the Getting Started documents (link at the top right) including the Rules of Engagement. 

    NOTE: Getting the link is easy enough for both the author and Blog.  Simply MouseOver the item, Right Click, and select Copy Shortcut.  Paste it into your Discussion.  You can also click on the url after pasting.  Click on the A to expand the options and select T (on the right) to Auto-Title the url.

    Thanks, Mike (Moderator)

    SAP Technology RIG

  • First of all awesome work ,
    I am facing one issue if anyone can help, I need to display a data like “Ashburn/Orchestrator1/blahblah”…..But when i try to set is not coming complete and shows “…” below the graph axis Y.
    Can someone help me with this, i dont wanna use CSS just for one step, and i am unable to find any property or code related to it