首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spotfire-Ironpython:读取“Color by”属性

Spotfire-Ironpython:读取“Color by”属性
EN

Stack Overflow用户
提问于 2019-02-11 01:34:56
回答 1查看 1.1K关注 0票数 1

使用TIBCO Spotfire Desktop v.7.0.0。我有一个ScatterPlot,其中的数据点是使用'Color By‘功能分类的。在“颜色依据”中,属性是手动选择的。

我试图实现的目标只是使用IronPython程序打印出这些属性。

到目前为止,这是我的尝试:

代码语言:javascript
复制
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]>

而我希望获得我使用“Color by”过滤设置的属性(列)名称。有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2019-02-12 12:42:50

这段代码将显示条形图的颜色轴的所有可读属性。如果您需要更具体的信息,请编辑您的问题,提供更多详细信息。

代码语言:javascript
复制
from Spotfire.Dxp.Application.Visuals import BarChart

v = viz.As[BarChart]()

print dir(v.ColorAxis)
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54619098

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档