Skip to Content
author's profile photo Former Member
Former Member

Not able to define variable in FeedItem

Hi All,

We are using vizFrame to display a chart. The chart has 4 measures ms1, ms2, ms3 and ms4.

However, not all of them need to be displayed. Based on the checkboxes that user selects, we want to switch ON / OFF a particular measure from the graph.

For this we are using the following statement in the controller on Checkbox Press:-

var yaxis = '["ms1", "ms3"]'; <- This variable is updated based on checkboxes selected

var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({

'uid': "valueAxis",

'type': "Measure",

'values': [yaxis]

}),

Issue :-

We get an error message ""Failed to update chart 50014 : Feed "ms1 , ms3" could not accept more containers.

Looks like it expects the actual measures to be mentioned in the 'values' property and not a variable name.

Any idea on how to specify values to the FeedItem through a variable name ?

Note - When we write the following lines of code then everything seems to work fine, but it doesn't serve our purpose :-

var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({

'uid': "valueAxis",

'type': "Measure",

'values': ["ms1", "ms3"]

}),

Thanks,

Ashish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 24, 2016 at 04:17 AM

    just build the yaxis as an array (instead of a String like what you have now) and pass it as 'values' property directly

    var yaxis = ["ms1", "ms3"]; // <- Array is updated based on checkboxes selected

    var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({

    'uid': "valueAxis",

    'type': "Measure",

    'values': yaxis

    })

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.