on 07-27-2016 2:46 PM
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);
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.