The Spotfire Community is moving to TIBCOmmunity and this forum location has closed. During the transition, you can still search the old forums but posting has been disabled. We encourage you to pick up the discussion at the new Spotfire community on TIBCOmmunity.
Add Line on Chart with Script control - TIBCO Spotfire Community

Add Line on Chart with Script control

Last post Wed, May 2 2012 11:04 PM by jcskalant. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Thu, Mar 29 2012 9:46 AM

    • AC- E
    • Not Ranked
    • Joined on Thu, Mar 29 2012
    • Posts 2

    Add Line on Chart with Script control

    Hi All , I would like to add a new vertical line with script control. In fact, i want to create a lot of bar charts, with a vertical line (column property value). That's why I'm using script control. Is it possible to do that?
  • Wed, May 2 2012 11:04 PM In reply to

    • jcskalant
    • Top 10 Contributor
    • Joined on Sun, Aug 21 2011
    • Panamá
    • Posts 258

    Re: Add Line on Chart with Script control

    Hi,

    Assuming you have already defined the vertical reference line bound to the property you want.... and that this reference line has an index [0] amongst all references lines... (this will be your first defined vertical line)... a script like this should work for all the barchart Viz on the same page:

    import Spotfire.Dxp.Application

    import Spotfire.Dxp.Application.Visuals

    from Spotfire.Dxp.Application.Visuals import BarChart

    for vis in Application.Document.ActivePageReference.Visuals:

    if vis.TypeId.Name=="Spotfire.BarChart":

    if vis.As[BarChart]().FittingModels[0].Enabled==True:

    vis.As[BarChart]().FittingModels[0].Enabled=False

    else:

    vis.As[BarChart]().FittingModels[0].Enabled=True

    Juan Carlos Escalante
Page 1 of 1 (2 items)
©Copyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center