Jump to content
We've recently updated our Privacy Statement, available here. ×

Create TablePlot visualization using IronPython


Mohd faizal Adris

Recommended Posts

I have managed to create TablePlot visualization using IronPython according to thissuggestion.

What I'm struggling to understand now is how can I clear the TablePlot since I keep receivingan alert message "A table plot column already exists for the data column".

 

from Spotfire.Dxp.Data import *

from Spotfire.Dxp.Application.Visuals import *

from System.Collections.Generic import List

 

#Different Data Tables

table1=Document.Data.Tables["table1"]

table2=Document.Data.Tables["table2"]

 

#list of Column to add

listofColumns=List[DataColumn]()

for column in table1.Columns:

#excluding column "columnName" from the list

if column.Name!="columnName":

listofColumns.Add(column)

#Add a script parameter "table" referring to the TablePlot visualization in the analysis

tableVis=table.As[TablePlot]()

tableVis.Data.DataTableReference=table1

tableVis.TableColumns.AddRange(listofColumns)

Link to comment
Share on other sites

  • 2 weeks later...

To clear the entire table plot, you can use

 

tableVis.TableColumns.Clear()

instead of

 

tableVis.TableColumns.AddRange(listofColumns)

 

If you want to clear individual columns, collect them in a list and run them through a for loop with the following line:

tableVis.TableColumns.Remove(listofColumns)

where listofColumns is the column list and i is the iteration.

 

Best,

Raghav

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