Alan F Posted July 31 Share Posted July 31 Below is my current code: from Spotfire.Dxp.Application import Filters as filters from Spotfire.Dxp.Application.Filters import ValueRange from System import DateTime myPanel = Document.ActivePageReference.FilterPanel for filterGroup in myPanel.TableGroups: if filterGroup.Name == 'Radar Health': myFilter = filterGroup.GetFilter("DateTime") rangeFilter = myFilter.FilterReference.As[filters.RangeFilter]() rangeFilter.StepLowLimitUp() rangeFilter.StepHighLimitDown() ''' startTime = DateTime.ParseExact('1/1/0001 5:59:30 pm', 'd/M/yyyy h:mm:ss tt', None) endTime = DateTime.ParseExact('1/1/0001 5:59:55 pm', 'd/M/yyyy h:mm:ss tt', None) rangeFilter.ValueRange = ValueRange(startTime, endTime) ''' I know the below methods can move to the range step by step, but it is slow: StepHighLimitDown Steps the high limit down to previous value. StepHighLimitUp Steps the high limit up to next value. StepLowLimitDown Steps the low limit down to previous value. StepLowLimitUp Steps the low limit up to next value. What I want is to set the filter range by values without affect the min and max values, like the following; I try to use the value range, but it did not work. Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted July 31 Share Posted July 31 Hi Alan, Just to confirm, in your screenshot, you want to be able to drag the range, between start- and end date, but you want to keep the initial start date (28/2/2023 6.00.27 pm) and end date (28/2/2023 6.04.02 pm) to be displayed at all times. Kind regards, David Link to comment Share on other sites More sharing options...
Alan F Posted July 31 Author Share Posted July 31 Hi David, This is the full range: What I want to establish is like below which I drag the filter value by mouse manually. But I want to use script to achieve this outcome. For example, after I get the values start datetime '28/2/2023 6:02:21 pm' and end datetime '28/2/2023 6:10:07 pm', then set the filter status like below image. The left and right datetime are still indicated the current range that I am focusing on, I can use mouse to drag the low limit and high limit back to the min and max value anytime. Moreover, the filter is part of a tables filtering scheme and place on text area, not a zoom slider of a visualization. Best regards, Alan Link to comment Share on other sites More sharing options...
Vanessa Virginia Sucre Gonzalez Posted July 31 Share Posted July 31 Hi Alan, so the idea is to have a range filter with an specific range focused and be able to move that specific range with up and down buttons for example? I think I have a good idea for a solution but I want to get everything clear Link to comment Share on other sites More sharing options...
Alan F Posted August 1 Author Share Posted August 1 15 hours ago, Vanessa Virginia Sucre Gonzalez said: Hi Alan, so the idea is to have a range filter with an specific range focused and be able to move that specific range with up and down buttons for example? I think I have a good idea for a solution but I want to get everything clear Not exactly, but similar. Actually, I have a list on the right side, which is a table, when I mark a row on the table, a data function will be called and pass the date and time for that row to a document property and the script attach on it will be called. The script will get the data from the document property then set the specific range. Link to comment Share on other sites More sharing options...
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