Jump to content
  • How to toggle Tooltip Detail items for different visualizations in Spotfire® Using IronPython Scripting


    Below is a sample Ironpython script to toggle different items in the tooltip based on a document property

    Introduction

    Below is a sample IronPython script to toggle different items in the tooltip based on a document property

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import *
    from Spotfire.Dxp.Application.Visuals.Maps import *
    
    barChart=bchart.As[BarChart]()
    if Document.Properties["prop1"]=="condtion1":
      barChart.Details.Items.Item[0].Visible=False
      barChart.Details.Items.Item[1].Visible=True
    if Document.Properties["prop1"]=="condtion2":
      barChart.Details.Items.Item[1].Visible=False
      barChart.Details.Items.Item[0].Visible=True
      
    
    mapchart=mchart.As[MapChart]()
    
    for layer in mapchart.Layers:
    #specify the Marker Layer Name
      if layer.Title=="SalesAndMarketing":
    # use MarkerLayerVisualization or FeatureLayerVisualization depending upon the layer
        mLayer=layer.As[MarkerLayerVisualization]()
        if Document.Properties["prop1"]=="condtion1":
            mLayer.Details.Items.Item[0].Visible=True
            mLayer.Details.Items.Item[1].Visible=False
        if Document.Properties["prop1"]=="condtion2":
            mLayer.Details.Items.Item[0].Visible=False
            mLayer.Details.Items.Item[1].Visible=True
     

     

    References

    License:  TIBCO BSD-Style License

     

    Back to IronPython Scripting in Spotfire Examples

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...