简体   繁体   中英

Spotfire-Ironpython: Read the 'Color by' properties

Working on TIBCO Spotfire Desktop v.7.0.0. I have a ScatterPlot where the data points are classified using the 'Color By' feature. In 'Color By', properties are manually selected.

The goal I am trying to achieve is simply to print out these properties using an IronPython program.

So far, this is my attempt:

from Spotfire.Dxp.Application.Visuals import ScatterPlot

page = Document.ActivePageReference
for visual in page.Visuals:
    if visual.TypeId.Name == 'Spotfire.ScatterPlot':
        v = visual.As[ScatterPlot]()

        # Here I want to print the 'Color By' properties

        # print all attributes of the ColorAxis
        print(dir(v.ColorAxis))

        # I tried to read the properties of the ColorAxis using the GetProperties() attribute as follow: 
        axis = v.ColorAxis 
        print(axis.GetProperties()) 

        # What I get is something like:    
        <Spotfire.Dxp.Application.Visuals.Axis+ <Spotfire.Dxp.Data.DataProperties.IDefinesImplicitDataProperties.GetPropertyNames>d__8 object at 0x0000000000000040 [Spotfire.Dxp.Application.Visuals.Axis+<Spotfire.Dxp.Data.DataProperties.IDefinesImplicitDataProperties.GetPropertyNames>d__8]>

While I am expecting to get the property (column) names I set using the 'Color by' filtering. Any ideas?

this nugget of code will display all of the readable properties of the Color axis of a bar chart. if you need more specific information, please edit your question with more details.

from Spotfire.Dxp.Application.Visuals import BarChart

v = viz.As[BarChart]()

print dir(v.ColorAxis)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM