Search code examples
ironpythonspotfire

Show all data when no items are marked


In Spotfire, is there a way to write a script that changes the default setting of "Empty Visualization" when no items are marked? I have a button that changes the chart from line to bar (and then back again) but since I am using a heat map to mark values the charts default show no data until I select on of thsoe values in the heatmap.


Solution

  • the chart property you're looking for is called LimitingMarkingsEmptyBehavior and accepts a LimitingMarkingsEmptyBehavior value. here's an example you could put on a button:

    from Spotfire.Dxp.Data import LimitingMarkingsEmptyBehavior
    from Spotfire.Dxp.Application.Visuals import BarChart
    
    v = visualization_parameter.As[BarChart]()
    
    v.Data.LimitingMarkingsEmptyBehavior = LimitingMarkingsEmptyBehavior.ShowAll