2

テーブルの視覚化から列を追加/削除する方法に関する情報を見つけました。 http://www.bearonspotfire.com/dynamic-tables-using-scripts-in-spotfire

from Spotfire.Dxp.Application.Visuals import VisualContent
## we need to import this as it is an enum and we want to refer to it
from Spotfire.Dxp.Application.Visuals import TablePlotColumnSortMode

## get the table visualisation
table = tableVisualisation.As[VisualContent]()

## check what option user selected and remove column (if present) of other column(s)
if selectedOrder == usagesName and table.TableColumns.Contains(dataTable.Columns[lastAccessedName]):
    table.TableColumns.Remove(dataTable.Columns[lastAccessedName])
elif selectedOrder == lastAccessedName and table.TableColumns.Contains(dataTable.Columns[usagesName]):
    table.TableColumns.Remove(dataTable.Columns[usagesName])

## add in new column assuming it isn't there already
if not table.TableColumns.Contains(dataTable.Columns[selectedOrder]):
    table.TableColumns.Add(dataTable.Columns[selectedOrder])

## set the sorting for the table
table.SortInfos.Clear();
table.SortInfos.Add(dataTable.Columns[selectedOrder], TablePlotColumnSortMode.Descending)

## changing the table resets the column size so lets fix it
addedColumn = table.TableColumns.TryGetTableColumn(dataTable.Columns[selectedOrder])[1]
addedColumn.Width = 120

クロステーブルの視覚化についても同じことを行う必要があります。

4

1 に答える 1