Jump to content
  • Create Scrolling Legend with Unlimited Items


    This article presents two solutions for handling extensive legends in Spotfire. A first approach is to use a Treemap Visualization as a legend, although this method can become crowded with a large number of items. Alternatively, another solution involves using a Cross Table to create a scrolling legend, which provides a more manageable way to display numerous items.

     

    Background

    Spotfire limits chart legends to 29 items, however, a user may want more items to be shown. A simple solution is using a Treemap Visualization as a legend, though that may become crowded. Another (more advanced) solution is to use a Cross Table to create a scrolling legend, as shown here.

    Step-by-step

    1) Create Cross Table and set Horizontal Axes to "(None", set Vertical Axes to [Your Column], and use the First() aggregation to set Cell Values to "First([Your Column)]". Also change the Display Name of Cell Values to a desirable name in the aggregation's window:

    2) Create a Color By grouping for your column, set the Color Mode to "Unique values", and align the color scheme with your reference chart:

    3) In the Title Bar, go to Controls visibility and uncheck "Axis Selectors"

    axis_selectors.png.0842f425bbd88bd1dd17ecee86e84502.png

    4) Unselect "Use separate color for marked items", reduce the first column size, and update the Cross Table title to finalize the formatting of your legend:

    5) To completely hide the first column use run this IronPython script once, with 'vis' set to your Cross Table:

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    # 'vis' is a script parameter
    
    # Import Modules
    from Spotfire.Dxp.Application.Visuals import *
    
    # Set row header column width to 0 (i.e. first column)
    vis.As[CrossTablePlot]().RowHeaderWidths.Item[0]=0
     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...