cancel
Showing results for 
Search instead for 
Did you mean: 

Disable sap.viz BarChart animation

guillaume-hrc
Active Contributor
0 Kudos

Hi,

I followed thread but was unable to disable animation.

I need to update the chars data very frequently so animation makes the chart worthless...

I tried to "switch" animation off using:


var oPlotArea = oBarChart.getPlotArea();

oPlotArea.destroyAnimation();

You can see the example of this in this JSBin

http://jsbin.com/yudeza/3/edit?html,output

Thanks in advance for your help.

Best regards,

Guillaume

Accepted Solutions (1)

Accepted Solutions (1)

kai2015
Contributor
0 Kudos

So, if you would transfer the XML coding from the mentioned example to JS, it will work.

    var oBarChart = new sap.viz.ui5.Bar({

        width: "800px",

        height: "400px",

        plotArea: new sap.viz.ui5.types.Bar({         

              animation: new sap.viz.ui5.types.Bar_animation({

                dataLoading: false,

                dataUpdating: false

              })

        }),

        title: {

            visible: true,

            text: 'Total Product Sales by Unit Price'

        },

        dataset: oDataset

    });

JS Bin

guillaume-hrc
Active Contributor
0 Kudos

Many thanks !!

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Just so you guys know the end of the story.

I managed to disable the animation but the sap.viz library was not "powerful" enough (or I missed something) to support updating while dragging a slider (yes, that was kind of demanding!)

Thus, I ended up building some graphs with D3.js using the fantastic examples by Mike Bostock and the result was pretty convincing! 

If I have time, I'll try wrapping them up in reusable SAPUI5 components (notice the non-committing sentence)

Best regards,

Guillaume

Message was edited by: Guillaume GARCIA

Answers (1)

Answers (1)

SergioG_TX
Active Contributor
0 Kudos

Hi Guillaume,

instead of destroyAnimation(), did you try destroyInteraction()?

I don't see the destroyAnimation() function in the API documentation

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Thanks but, nope, this has not the expected effect.

destroyAnimation is a method of the Bar chart's plotArea:

JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.viz.ui5.types.Bar

Best regards,

Guillaume