Skip to main content

Hi community,

 

I am wondering if it's possible to have the x-axis range (a measure) automatically adjust when a user uses a highlight action on a dashboard. I'm looking for a sort of "zoom in" effect that focuses on the highlighted values, and automatically changes the min/max axis values to adjust to those values. Not even sure if this is possible, but I appreciate any suggestions/advice!

3 个回答
  1. 2023年6月8日 17:39

    @B B 

    There are several options you might try, depending on the behavior you're after.

    Supposed you want your graph to zoom in around a central selected point (let's call it X, Y) with each click.

    Create two Change Parameter actions to capture the element's position in [X Param] and [Y Param]. When unselected, the parameters should return to a value like -1 (one which never appear in your graph).

     

    You can then create calcs that will limit the visibility of your graph:

     

    X Display

    IIF([X Param]=-1, TRUE,( [X Axis]>=([X Param]-10) AND [X Axis Measure]<=([X Param]+10))

     

    This logic reads: If the [X Param] is unset (-1), use all [X Axis Measure] values. Otherwise, look at the range between around the current point and allow only points +/- 10 "units" to be displayed. Naturally, you will need to modify these units to get the zoom level you prefer.

     

    The same for Y:

    Y Display

    IIF([Y Param]=-1, TRUE,( [Y Axis]>=([Y Param]-10) AND [Y Axis Measure]<=([Y Param]+10))

     

    Add these to your filters, allowing only TRUE values to flow through. You may get something like this:

    (Zoomed out)

     

    @B B There are several options you might try, depending on the behavior you're after.Supposed you want your graph to zoom in around a central selected point (let's call it X, Y) with each click. 

    (zoomed in)

    imageI hope this offers a bit of inspiration.

    Michael Hesser (Tableau Forum Ambassador)

    If this response has answered your question, kindly click "Best Answer"

0/9000