on 12-11-2017 11:09 AM
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.
In order to update the measures/dimensions, you should destroy the dataset and feedItems first which were previously bound to vizFrame:
vizFrame.destroyFeeds();
vizFrame.destroyDataset();
Then you redefine the new ones:
var newDataset = new sap.viz.ui5.data.FlattenedDataset(...);
var newFeeds = new sap.viz.ui5.controls.common.feeds.FeedItem(......);
You could use vizUpdate to bound them back to vizFrame
vizFrame.vizUpdate({data: "newDataset", feeds: "newFeeds"})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.