Skip to Content

Axis showing label value in millions in vizframe

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);

Capture.JPG (16.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 28, 2016 at 06:15 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.