Jump to content
We've recently updated our Privacy Statement, available here. ×

How to set zoom slider to latest year on x-axis of a line chart


Recommended Posts

Hi All,

I have a scenario where I want to set the zoom slider to latest year

as of now below is the default view of the line-chart:

image.png.e289ae69b73e1fce3e0ef4ccae468820.png

when someone opens the analysis they should be able to see below view by default:

image.png.1a00ed0df723cdd1c5c8facd9d60bacb.png

How can this be achieved?

Regards,
Prateek

Link to comment
Share on other sites

A way of achieving this would be to effectively limit the visualization to the latest year.
In the line chart properties, go to the Data tab, scroll down to "Limit data using expression", click on "Edit" and input the following expression:

 

Year([myDate])=Max(Year([myDate]))

where [myDate] is your date column.

If you want to keep the alternative of seeing everything vs seeing only the latest year, you could define a document property (say you call it visibleDateRange) and then add a text area with a drop-down choice which populates this property.  This would be set either to "True" (meaning all data allowed) or to the expression above (see screenshot).
Then you set this property as the Limit data using expression as:
 

${visibleDateRange}

 

dropdown.png

all.png

latestYear.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...