Jump to content

How can I set the range filter to step to the exact range by specific values ?


Alan F

Recommended Posts

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:

Public method StepHighLimitDown
Steps the high limit down to previous value.
Public method StepHighLimitUp
Steps the high limit up to next value.
Public method StepLowLimitDown
Steps the low limit down to previous value.
Public method 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;

 image.png.e4326e9788b5fc1c1f0b643a19e9d508.png

I try to use the value range, but it did not work.

Link to comment
Share on other sites

Hi David,

This is the full range:

image.thumb.png.44bfbc8eea71a3d463c00c0374c769fa.png

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.
image.thumb.png.0a3a23ae3f324854fd2f2ea70aa3d8a4.png

Best regards,
Alan

Link to comment
Share on other sites

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

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...