0
votes

I would like to change Measures dynamically in my VizFrame like in ChartDemo App from sapui5 docs [link below].

https://sapui5.netweaver.ondemand.com/test-resources/sap/viz/demokit/chartdemo/index.html

So when I click to one of my five checkboxes the proper Measure will be added or removed in case of unchecking. I have one json from which I get data.

I've tried with this code:

if(oCheckBox.getSelected()){
                       oVizFrame.removeFeed(feedValuesAxis);
                       feedValuesAxis.setValues("ValueFromJSON");
                       oVizFrame.addFeed(feedValuesAxis);
                       }

But it causes error:

[50005] - valueAxis : does not meet the minimum or maximum number of feeds definition.

I am using SAP UI5 version 1.28. I have one VizFrame, one Dataset with all Measures and two FeedItem one for values and one for Dimension.

I guess I have to create a binding, right? But how should I do it? Thanks a lot for any pieces of advice.

1

1 Answers

0
votes

Simply, I have missed array when putting value into setValues() method.

So the answer is:

feedValuesAxis.setValues(["ValueFromJSON"]);