【发布时间】:2019-05-29 19:03:50
【问题描述】:
我的 Spotfire 仪表板中有一个交叉表,我正在尝试使用 Iron Python 脚本更改“计算总计”选项。
我在 Spotfire API 上找到了this link。因此,据我了解,此信息存储在 myVis.Totals 中。但是,无论出于何种原因,这似乎是一个只读属性,如 here 所示。
你们中有人遇到过这个问题并且知道如何解决吗?
这是我的代码:
from Spotfire.Dxp.Application.Visuals import *
# myVis is a script parameter of the type "Visualisation"
myVis = myVis.As[Visualization]()
myVis.Totals = CrossTableTotals.CalculationMode.SumOfCellValues
这是我得到的错误:
Traceback (most recent call last):
File "<string>", line 5, in <module>
AttributeError: can't assign to read-only property Totals of type 'CrossTablePlot'
System.MissingMemberException: can't assign to read-only property Totals of type 'CrossTablePlot'
at CallSite.Target(Closure , CallSite , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
at Spotfire.Dxp.Application.IronPython27.IronPythonScriptEngine.ExecuteForDebugging(String scriptCode, Dictionary`2 scope, Stream outputStream)
【问题讨论】:
标签: python ironpython spotfire tibco