2

I am trying to "trellis" a summary table using a script. The TrellisVisualization is not available for the SummaryTable class. Using the GUI, I can trellis a summary table by assigning a specific column to the Categorization property under Columns Properties. However, while using the IronPython script, I don't see any property named Categorization for the SummaryTable object. So, I tried assigning the column to the CategoryAxis as follows:

    mySummaryTable.CategoryAxis = "<[myColumn]>"

But this throws an error:

    AttributeError: 'SummaryTable' object has no attribute 'CategoryAxis'

I also tried using Axis or CategoricalAxisBase etc. as properties, but these options did not work out. If anyone has more ideas on this, please let me know. Thanks. RD

4

1 回答 1

2

这里的关键问题是 Summary Table 类下的 CategoryAxis 属性是 GroupByAxis 类的这个视觉对象的 GET。您可以通过使用 print 命令并获取有关对象的信息来看到这一点:

print mySummaryTable.CategoryAxis

结果是我的 Spotfire 示例:
<Spotfire.Dxp.Application.Visuals.GroupByAxis object at 0x000000000000002C [Spotfire.Dxp.Application.Visuals.GroupByAxis]>

不过,你实际上很接近。为了设置 CategoryAxis,您需要像这样设置 CategoryAxis 的 Expression 属性:

from Spotfire.Dxp.Application.Visuals import SummaryTable

mySummaryTable = myVisual.As[SummaryTable]()
mySummaryTable.CategoryAxis.Expression = "<[COLUMN]>"

如果您需要将实际列名传递给其中而不是硬编码,我将连接表达式语法并将表达式设置为等于该变量:

myColumnExp = "<[" + myColumnName + "]>"
mySummaryTable.CategoryAxis.Expression = myColumnExp

如果您需要对此进行任何澄清,请告诉我。我的 Spotfire 版本是 v6.5.2.26,我的 API 信息来自https://docs.tibco.com/pub/doc_remote/spotfire/6.5.0/api/Index.aspx

于 2015-04-29T22:39:14.370 回答