cancel
Showing results for 
Search instead for 
Did you mean: 

Axis showing label value in millions in vizframe

0 Kudos

Hi All, I have a situation where my y-axis label values are showing in millions (as in the picture). The backend service is sending value as integer values but they are just number of loads and not any financial figures to be displayed in millions. Can anyone please suggest me a way to format the label into small integer values and not in millions value. My code is as below:

var amModel = new sap.ui.model.json.JSONModel({

   'businessData' : [

  {date:"20.10.2016",item:"books",loads:1},

  {date:"20.10.2016",item:"notebooks",loads:2},

  {date:"20.11.2016",item:"Pens",loads:3},

  {date:"20.11.2016",item:"notebooks",loads:2},

  {date:"20.12.2016",item:" ",loads:" "}

   ]

  });

   var oDataset = new sap.viz.ui5.data.FlattenedDataset({

  'dimensions' : [{

   'name' : 'date',

   'value' : "{date}"

  },{

  'name' : 'item',

  'value' : "{item}"

  }],

  'measures' : [

  // measure 1

  {

   'name' : 'No of loads', // 'name' is used as label in the Legend

   'value' : '{loads}' // 'value' defines the binding for the displayed value

  }],

  'data' : {

   'path' : "/businessData"

  }

   });

oVizFrame.setVizProperties( {

                valueAxis: {

                    label: {

                        formatString: 'u'

                    }

                },

                legend : {

                    visible : true

                },

                title : {

                    visible : true,

                    text : titletext

                },

                tooltip: {

                    "visible": true

                }

            });

  

   oVizFrame.setDataset(oDataset);

   oVizFrame.setModel(amModel);

   var feedPrimaryValues = new sap.viz.ui5.controls.common.feeds.FeedItem({

  'uid' : "valueAxis",

  'type' : "Measure",

  'values' : ["No of loads"]

   }), feedregionColor = new sap.viz.ui5.controls.common.feeds.FeedItem({

  'uid' : "color",

  'type' : "Dimension",

  'values' : ["item"]

   }),feedAxisLabels = new sap.viz.ui5.controls.common.feeds.FeedItem({

  "uid" : "categoryAxis",

  "type" : "Dimension",

  "values" : ["date"]

   });

  

  oVizFrame.addFeed(feedPrimaryValues);

  oVizFrame.addFeed(feedAxisLabels);

  oVizFrame.addFeed(feedregionColor);

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member196805
Contributor
0 Kudos

Hello, please check this snippix JS Bin - Collaborative JavaScript Debugging. I don't see the same valueAxis scale as you. Did you customized the scaling maxValue and minValue yourself?

the little m stands for milli. so 100m = 0.1 since 1m = 0.001. For more info, please check this wikipedia https://en.wikipedia.org/wiki/Metric_prefix. The reason of showing prefix because you have formatString set as 'u' and this will trigger the valueAxis.label.unitFormatType method.

If you don't want the float number to show in prefix, just remove 'u' from the formatString.

BR,

Chapman

0 Kudos

Hi Wong,

Thanks for the reply. That's the thing that i am not doing any custom formatting and the problem still remains even after removing the formatString value. And yes, its milli and not millions. I thought it is displaying financial data so it came to my mind while posting this question. But anyways, the problem doesnt get resolved.

BR,

Abinash

0 Kudos

Could it be that my UI5 library version is different from what is there onDemand hence i cannot reproduce the error anywhere except my HANA instance?

former_member196805
Contributor
0 Kudos

What's the version of SAPUI5 deployed on your system?