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: 
Not applicable

Setting Trellis Column dynamically

I'd like to let the user change the number of columns that appear in a Trellis chart dynamically. Is it possible to do this? I'm thinking of having a multibox with a range of values

Here's the psuedo logic I'm thinking.

=if(GetSelectedCount(of multibox field)=1, set trellis column property = value of multibox field, set set trellis column property = 3)

Questions:

-How do I set the trellis column property?

-Where would this logic go? In a trigger that detects whenever the multibox changes?

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

May be you can try with Macro.. Like

sub TrellisColumn()
      set chart = ActiveDocument.GetSheetObject("CH01")
      set p = chart.GetProperties
      Column=ActiveDocument.Evaluate("Column")
      Row=ActiveDocument.Evaluate("Row")

      p.ChartProperties.TrellisProperties.EnablePrimaryDimension=true
      p.ChartProperties.TrellisProperties.EnableSecondaryDimension=False
      p.ChartProperties.TrellisProperties.Columns=Column
      p.ChartProperties.TrellisProperties.Rows=Row
      chart.SetProperties p
End sub


Source: API Guide


Sample Attached


View solution in original post

2 Replies
settu_periasamy
Master III
Master III

May be you can try with Macro.. Like

sub TrellisColumn()
      set chart = ActiveDocument.GetSheetObject("CH01")
      set p = chart.GetProperties
      Column=ActiveDocument.Evaluate("Column")
      Row=ActiveDocument.Evaluate("Row")

      p.ChartProperties.TrellisProperties.EnablePrimaryDimension=true
      p.ChartProperties.TrellisProperties.EnableSecondaryDimension=False
      p.ChartProperties.TrellisProperties.Columns=Column
      p.ChartProperties.TrellisProperties.Rows=Row
      chart.SetProperties p
End sub


Source: API Guide


Sample Attached


Not applicable
Author

Works great! I may explore using a trigger instead of a button but works like a charm.