on 04-29-2015 7:19 AM
Howdy SCNers,
I'm building a VizFrame chart using a dataset with pretty big numbers (e.g. in the millions). Example below:
{
data: [{
date: '2015-01-01',
value1 : 9000000,
value2 : 8000000
},{
date: '2015-01-02',
value1 : 9200000,
value2 : 8100000
},
etc.]
}
when the chart renders, it renders with a wonky scale, running from 0 on the y-axis, to 8M. However, my dataset measurement values start at about 6M, so there's no point starting the y-axis at 0.
It should start at something more reasonable, say, 6M. To do this, typically, you'd use the chart's yAxis aggregation, and supply an Axis object with an Axis_scale (see below).
var yAxis1 = new sap.viz.ui5.types.Axis("idYAxis",{
scale : new sap.viz.ui5.types.Axis_scale("idYAxisScale",{
minValue : 6000000,
maxValue : 8000000
})
});
oVizFrame.setDataset(oDataset);
// Not necessary, but so I don't get told I'm not supplying a model...
// (oData model is already bound to the view
oVizFrame.setModel(this.getView().getModel());
oVizFrame.setVizType("line");
oVizFrame.setUiConfig({"applicationSet": "fiori"});
oVizFrame.setVizProperties({
...lots of properties, and...
yAxis : yAxis1
});
When I do this however, and set my scale to between 6M and 8M, the Viz controller (in function clone(), which is recursive), reaches the max call stack (I'm in Chrome... naturally). I've linked to the debug file, below.
https://sapui5.netweaver.ondemand.com/resources/sap/viz/ui5/controls/libs/sap-viz-controls-dbg.js
If I remove the yAxis property, the chart renders, as you can see above. Is this a bug? Can you reproduce it? What do you think the solution would be? I don't wan't to - shouldn't have to - tamper with my data (to bring the scale down).
Cheers
Edited for clarity, Hagen
Hi Hagen,
I actually think setVizProperties should not take any objects created with new..., but "simple" JavaScript objects.
How about
oVizFrame.setVizProperties({plotArea:{secondaryScale:{fixedRange: true, maxValue: 8000000, minValue: 6000000 }}});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.