Search code examples
data-visualizationspotfire

Match two trellis pages between two different graphs


I want to have on the same page a pie chart and a bar chart, with trellis pages. They both have 5 columns as trellis, so 5 different pages that you can visualize by scrolling down.

However, I would like to display the same pages at the same time for both graphs. For instance, let's imagine I'm on the pie chart, I scroll down one page - and so my pie chart is on page2 - I want my bar chart to automatically go to page 2 as well

I tried to use markings but although it links a bit the two graphs, it doesn't change the trellis pages automatically

Does anyone know how to do this ?


Solution

  • as @scsimon mentions, there's no native feature (nor API method, AFAIK) for this using a trellis. however, you can create a Property Control (I'd use a dropdown) in a Text Area, then use the same Document Property to your chart in a Limit By expression.

    little more detail, assuming a data table like this:

    A   B   CATEGORY
    1   2   red
    3   4   red
    5   6   green
    7   8   green
    9   10  blue
    11  12  blue
    
    1. add a Text Area to the page and edit its contents
    2. add a Property Control
    3. click New to create a Document Property, give it a type String and a name category
    4. change Set property value through to Unique values in column and choose the "category" column and click OK
    5. save the Text Area contents
    6. in your Pie Chart's Properties dialog, go to the Data page and look for Limit data using expression. click Edit
    7. set the expression to: [CATEGORY] = "${category}" (don't forget the quotes or the Document Property won't be treated as a string and you'll get an error)
    8. repeat steps 6 & 7 for your other chart