Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
naushad786
Contributor
Contributor

dynamically creating objects based on selection

Hi,

I have a listbox and a bar chart.

For each selection in the listbox,I have to create one bar chart.

If i select only one value in listbox then there should only one bar chart showing the details of the selected value,

if I select two values from list box then there should be two bar chart one showing details of firstvalue and the second showing details of second value.

I don't want to pre-create chart and display it on selection of values in listbox as the values in listbox will go on increasing.

Any help on this is really appreciated.

Thanks,

Naushad

1 Reply
Peter_Cammaert
Partner - Champion III
Partner - Champion III

The problem with this approach is that in the AP, you won't be able to manipulate the User Interface in say the AJAX client. IMHO you should always go for pre-created bar charts. Most of the time, a lot of them will be hidden.

A way to accomplish this may be:

  • Define the maximum number of bar charts/expressions that a user will want to compare. Let's say that four (4) is a sensible choice. More objects will reduce the area for each bar chart and may make them hard to use. Largely depends on the amount a values in each of them.
  • Arrange them into a grid.
  • Add a conditional show to each bar chart. Always show the first bar chart, even when there is no selection and all values in your listbox turn white. Use the first selection/possible listbox value in the expression. If there are two or more selections, use the second selection in the second bar chart (and unhide it). If there are three or more selections, ...
  • For each bar chart, create an expression that uses the nth value in the listbox.

The easiest way to define the four expressions is to use variables and to create actions that change the variables every time a selection in the listbox is made.

Peter