B I Posted February 7, 2019 Posted February 7, 2019 Hi all With a "reset button", I need to reset the hierarchy slider on the category axis of a bar chart to the "most specific" level (month): I've tried achieving this by setting the X-axis expression in IronPython but this weirdly causes the "time" part (00:00:00) of the date data column to display alongside the month or year (see image below): vis.As[LineChart]().XAxis.Expression = 'BinByDateTime([install Date],"Year.Month",1)' Is there a better way to programmatically set the "hierarchy level" of the category axis Does anyone know how to suppress the appearance of the "time" Thanks a lot, Ben
Alain Martens Posted February 8, 2019 Posted February 8, 2019 Hi Ben, Could you use bookmarks to reset the slider to the position you like I attached a dxp (version Spotfire X) as a sample. Best regards, Alain
B I Posted February 11, 2019 Author Posted February 11, 2019 Thanks for the response. Unfortunately, I am unable to use Bookmarks as I have been led to believe that they will interfere with (or poossibly override) our client log-in permissions. I'm really hoping to get an IronPython script that will replicate the functionality of a bookmark.
Alain Martens Posted February 11, 2019 Posted February 11, 2019 Hi Ben, Not sure how the bookmarks can override your client log in. Regardless, solving this using IronPython can be done by using the date function to format the result from your BinByDateTime function. vis.As[LineChart]().XAxis.Expression = 'Date(BinByDateTime([Date],"Year.Month",1)) AS ''Date''' Another option would be to place < and > around the BinByDateTime function. This makes it a categorical value and retains the slider. Like this: Best regards, Alain
B I Posted February 11, 2019 Author Posted February 11, 2019 Thanks, Alain. Using the categorical tags worked perfectly, really appreciate it!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now