cancel
Showing results for 
Search instead for 
Did you mean: 

VizFrame (chart) axis scale too large - max call stack reached

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks Bjorn,

I don't need this any more, but you may be onto something! It is highly probable that I was "doing it wrong"!

Cheers,

Hagen

Answers (0)