Jump to content

Setting min and max on Y-axis items with IronPython

D.J. J

Recommended Posts

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.


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


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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...