Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3180

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

$
0
0

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.

Chart y-axis issue.PNG

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


Viewing all articles
Browse latest Browse all 3180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>