Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Clear Marking



Method 1: Clears marking form a given visualization

#vis and dataTable are script parameters.
from Spotfire.Dxp.Application.Visuals import ScatterPlot

from Spotfire.Dxp.Data import RowSelection

v1 = vis.As[ScatterPlot]()

from Spotfire.Dxp.Data import RowSelection, IndexSet

#prepare to unmark all rows
rowSelection = RowSelection(IndexSet(dataTable.RowCount,False))



#set visualization data table marking based on rowSelection
v1.Data.MarkingReference.SetSelection(rowSelection,dataTable)




Method 2: Clears marking form a given table

#clears marking from a given table
def clearMarkings(aDataTable):
from Spotfire.Dxp.Data import RowSelection, IndexSet, DataManager
dataManager = Application.GetService(DataManager)
for marking in dataManager.Markings:
rowSelection = RowSelection(IndexSet(aDataTable.RowCount,False))
marking.SetSelection(rowSelection,aDataTable)

#clear marking from all tables
for dataTable in Document.Data.Tables: clearMarkings(dataTable)

No comments: