D.J. J Posted May 4, 2020 Share Posted May 4, 2020 Hello, I am trying to set the min and max on the y-axis of a combination chartusing IronPython but getting an error. Does anyone have an idea what I am doing wrong Thank you. Code: from Spotfire.Dxp.Application.Visuals import CombinationChart from Spotfire.Dxp.Application.Visuals import AxisRange #To set the axis range: lChart = CombinationChart.As[CombinationChart]() newAxisRange = AxisRange(0, Document.Properties["Revenue"]) lChart.YAxis.IndexedRange["Gross_RevOil"] = newAxisRange lChart.YAxis.IndexedRange["Gross_RevCond"] = newAxisRange lChart.YAxis.IndexedRange["Gross_RevGas"] = newAxisRange lChart.YAxis.IndexedRange["Gross_Liquids"] = newAxisRange #To read the manually set axis range: print lChart.YAxis.IndexedRange["Gross_RevOil"].Low print lChart.YAxis.IndexedRange["Gross_RevOil"].High print lChart.YAxis.IndexedRange["Gross_RevCond"].Low print lChart.YAxis.IndexedRange["Gross_RevCond"].High print lChart.YAxis.IndexedRange["Gross_RevGas"].Low print lChart.YAxis.IndexedRange["Gross_RevGas"].High print lChart.YAxis.IndexedRange["Gross_Liquids"].Low print lChart.YAxis.IndexedRange["Gross_Liquids"].High Error: Traceback (most recent call last): File "", line 5, in AttributeError: 'type' object has no attribute 'As' System.MissingMemberException: 'type' object has no attribute 'As' at IronPython.Runtime.Binding.MetaPythonType.FastGetBinderHelper.ErrorBinder.Target(CodeContext context, Object self, Object& result) at IronPython.Runtime.Types.TypeGetBase.RunDelegatesNoOptimize(Object self, CodeContext context) 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) Link to comment Share on other sites More sharing options...
Tyger Guzman 2 Posted May 5, 2020 Share Posted May 5, 2020 ChangelChart = CombinationChart.As[CombinationChart]() to lChart = myVis.As[CombinationChart]() and set myVis as a script parameter as Type : visualization and select the visual you are tyring to change Link to comment Share on other sites More sharing options...
Shashank Gurnalkar Posted May 6, 2020 Share Posted May 6, 2020 In line 5, you are using 'CombinationChart' to createan object which itself is a keyword in Spotfire IronPython. Change the object name which is not a keyword like: lChart = CombChart.As[CombinationChart]() Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now