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

How can I populate a table visualization one column at a time based on the user input from a drop down list using IronPython script


Kevin Nguyen 4

Recommended Posts

The script below doesn't do what I want it to do Please help!

Please note that Vis1 is the script parameter.

Thanks for your help.

------------------------------------------------------------------------------

from Spotfire.Dxp.Application.Visuals import *

from Spotfire.Dxp.Data import *

from Spotfire.Dxp.Application.Visuals import TablePlot

 

Param1 = Document.Properties['Col1']

#print Param1

def getDataTable(tableName):

# try:

# return Document.Data.Tables(tableName)

# except:

# raise ("Error - Cannot find data table: " + tableName)

#here use your data table name

myDataTable = getDataTable("Merged Excel Files (4)")

# myDataTable = Vis1.As[TablePlot]().Data.DataTableReference

if Param1 == "Max(WellVolume) for" :

Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Max(WellVolume) for"])

# Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1])

if Param1 == "Max(FluidComposition) for" :

Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Max(FluidComposition) for"])

# Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1])

if Param1 == "Min(FluidComposition) for" :

Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Min(FluidComposition) for"])

# Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1])

if Param1 == "Avg(WellVolumne) for" :

Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Avg(WellVolumne) for"])

# Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1])

if Param1 == "Avg(FluidComposition) for" :

Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Min(FluidComposition) for"])

# Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1])

Link to comment
Share on other sites

  • 3 weeks later...

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