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.
May 2011 - Posts - Tip of the Week

Tip of the Week

May 2011 - Posts

  • Self-Drilling Visualizations

    In an earlier tip, we discussed the new bookmark capabilities in version 3.3 which allow you to capture visualization and document properties.  One practical example of how you can apply these new features is to create a self-drilling visualization.

    In this example we start by showing the  total orders from different product categories in a Horizontal Bar Chart (3.3 includes Horizontal Bar Charts)

     

    We can now capture a bookmark which will store the ‘Page Layout and Visualizations’ only using the ‘Add Bookmark Special’ command.


     

     


    This will capture how this Horizontal Bar Chart is setup and configured.

    Then, we should update the same visualization to use a new marking and also to limit the data shown to use the same marking from the original visualization configuration. In this example, the visualization initially was setup to use ‘Marking’ , identified by green.  Then we updated it to use ‘Marking (2)’,  identified by red and to limit data shown to the ‘Marking’ green marking.


     

    We then update our visualization to reflect the drill down by updating the Category Axis to show not only the Product Category, but also the Product column.

     

    NOTE: Since Spotfire supports Horizontal Bar Charts from version 3.3, the X and Y Axis on Bar Charts and Combination Charts have been replaced with Category Axis and Value Axis.

    Once the visualization is configured propertly, we then add another bookmark to capture this visualizations properties (using the ‘Add Bookmark Special’ command).


     

    Now we can add a Text Area and include the two bookmarks to allow the user to toggle the visualization between the top level (Product Categories only) and the sub level (the product(s) which are marked). You can see from the image below that the ‘Truck and Buses’ visualization is marked when all product categories are displayed.

    When second bookmark is executed, the visualization will update and drill into the specific marked products.

     

     

    By clicking on the first action link associated with the first bookmark, the visualization will revert back to showing all the Product Categories only.

  • Displaying Images and Links as Labels , Tooltips , and Column values from version 3.3

    Starting in version 3.3 of TIBCO Spotfire, Map Charts and Scatter Plots now have the capability to use images in labels and tooltips, as well as inside a column cell (Spotfire already supported virtual columns rendering blobs and images using  either the TIBCO Spotfire for Lead Discovery product or the SDK, but now this feature is supported out of the box).

    .

    For example, if you want to add images as labels to a Scatter Plot, you would goto the Properties dialog of the plot, and in the Labels section, choose to show the label as an ‘Image from URL’. You then need to define a column which contains the necessary information to point to the URL.


    You can either have the column values be the entire URL or just the filename and then use the ‘Settings’ option to specify the URL string to use.


     

    Once you have done this, your plot will now show the images as labels and will allow you to move the labels around the screen for better placement.



     
    In addition to images, labels can also be hyperlinks by setting the 'Show As' option to a 'Link'.

    Tooltips

    Similar to labels, you can now setups tooltips to display images.
     
     


    Columns

    Finally, you can also choose to display an image in a column inside of a Table visualization. To do this, when you specify the Columns to include in the table (from the Table’s Properties dialog), you can use the ‘Renderer’ option and set it to   ‘Image from URL’. You have the same options for setting the URL to retrieve the image as you do for the labels and tooltips.


     

     

    One very cool example, shown to us by one of our Product Managers (Greg G), is to connect to Google Charts to retrieve and display a sparkline for each row.


     

    Labels for interactive shapes
    One other related update in 3.3 includes labels for interactive shapes in Map Charts. Map Charts already support labels in previous versions, but only when the chart was configured to be either in map with markers or background image mode. From version 3.3, labels are now supported in the interactive shape mode.

    To define the labels, the user must specify a column to pick the labels from. The label column and the coloring column must be from the same data table. Since placement is important, the labels can be moved around manual and then saved by right clicking and selecting ‘Edit Label Positions’.
     

  • Subtotals and Sorting of Cross Tables from Spotfire v3.3

    In TIBCO Spotfire version 3.2, there were some updates to Cross Tables, which allowed users to add subtotals for each level of a given hierarchy.  In TIBCO Spotfire version 3.3, more updates were released to enhance and extend this functionality. 


    In 3.2 the subtotals were always applied to every parent level of a hierarchy. Now, starting in 3.3, you can specify which level of the Cross Table hierarchy should have subtotals applied. This is done in the Properties dialog for the Cross Table under the ‘Column subtotals’ section.


     
    You can also now specify whether the subtotals should be displayed before or after the axis values.

    In addition to this update, Spotfire now supports showing only the top or bottom N values in a specific Cross Table grouping. This is done in the Properties dialog for the Cross Table under the ‘Sorting’ section.
    There is a checkbox labeled ‘Show only top/bottom’ and we can set that option and the specific number for both columns and rows in the Cross Table. There is also a checkbox to specify whether there should be an indication that some rows or columns are hidden.

    For example, if our data has 20 rows of values for a specific grouping that are displayed by default in the Cross Table, and we set the option to only show the top 5, and also check the ‘Indicate hidden rows’ value, than only the top 5 will be shown and then a cell will be added with ‘ …’ in it representing that there is additional data which is currently hidden.

    Specifying whether the rows or columns should be in ‘Ascending’ or ‘Descending’ order will determine if the top or bottom N values are displayed.



     
    In addition, you can use the bookmark features to capture different states of the visualization properties to expose different options for the user via property controls. For example, you can  create bookmarks and then Action Controls which will toggle subtotals to be on top or bottom, as shown below:



     
    The option for specifying  the number of  rows or columns to display does not take in expressions, so there is no way to use property controls to alter these values directly, but you can do it with a bit of scripting and property controls. The following script will take in two parameters, cTable which refers to the specific Cross Table and intTopNRows, which refers to a property for setting the number of rows to show.

    from Spotfire.Dxp.Application.Visuals import CrossTablePlot
    crossTable = cTable.As[CrossTablePlot]()
    crossTable.ShowTopNRows = True
    crossTable.TopNRowCount = intTopNRows
     

     

     

  • Using Bookmarks to Create Guided Analysis in TIBCO Spotfire 3.3

    This week we will start a tip of the week arc where we introduce the new features of TIBCO Spotfire version 3.3. In this tip we will focus on how to use the updated Bookmark capabilities to create Guided Analytic Applications.  There are many other useful capabilities of bookmarks, like collaboration, which will be discussed in future tips.

     

    Bookmarks were updated in version 3.3 to support the capturing of properties as well as page layouts and visualization properties. These concepts come in very handy  when you want to ‘guide’ the user through an analytic process. Suppose we define a visualization which includes a document property in the expression used on one of its axes. We can modify the property values and capture bookmarks so that we can easily revert back to common configurations. 

    For example, suppose we have a Bar Chart which will display the yield of various mortgage amounts over 10 years, using an annual interest rate of 8%.

     


    As the author of the file, you may want the user to see what the total yield would be both at 8% and at 5%, and you would rather not take up the real estate to show 2 separate visualizations.  Using 3.3 Bookmarks, you can update the document property which contains the interest rate as part of the yield calculation, and then take a snapshot of that visualization, including the property. You can then update the property to a new value, and take another bookmark.


    Once this is done, we can now go into a Text Area and add Action Controls which will trigger the bookmarks as part of a guided analysis. When adding the bookmark to the Action Control, we want to add the ‘Properties’ component of the bookmark only. This will update the property to the value when the bookmark was captured.

     
    We can repeat this process and add another Action Control which will apply the second bookmark as shown below.
     

    In addition to using properties as part of Bookmarks, we can also capture page layouts and visualization properties. This will allow us to accomplish certain tasks which previously required a Script Control.  For example, in the example above, if we wanted to update the visualization’s title to display either ‘Total Yield for 5 percent interest’  or  ‘Total yield for 8 percent interest’ when the appropriate bookmark was applied, you would, as the author, update the visualization title to the correct title before capturing each bookmark. (for example, update the title to be 5 Percent Yield when you capture the 5 percent bookmark and then update the title to be 8 Percent Yield when you capture the 8 percent bookmark). Then when you apply the bookmark in the Action Control, you will add in both the ‘Properties’ and ‘Page Layout and Visualizations’ features.
     

     

    In addition to visualization titles, the new bookmark features allow you to take the same approach to any visualization property.  A good example would be to create bookmarks to turn the trellis feature either on or off.
     

     

    Another popular use for capturing the visualization properties in a bookmark is to create an affect where you are only displaying certain visualizations on the page when the user clicks on a link, ideally as part of a guided process.

    Take a look at the example below, which shows some text in a text area and then a Combination Chart which shows the sum of sales from each sales representative.


    By capturing bookmarks , we can now create an action link (which shows up as a link in the text area to the left) that will change the visualizations on the right, including new instructions in the text area, and then a Combination Chart which shows sales predications and quotes for each sales team.

     

    A key point to mention is that, when doing this approach, the visualization types have to be the same. So, in the example above, the two visualizations used in the bookmark were always a Text Area and a Combination Chart…this would not work if we tried to have a different visualization at one point.  You can update any property in a visualization, like the title, the data table used, the axis expressions, etc..., but the visualization type needs to remain the same.

  • Performing Data Entry and Analysis with TIBCO Spotfire - Part II

    In last week’s tip we learned how to enter data via property controls inside TIBCO Spotfire and then add this data to an existing data table already loaded. In this week’s tip we will do something similar, except rather than adding rows to the data table, we will use property controls to update a calculated column to drive our analysis.

     

    The scenario we will use for this is an online training needs assessment. Consumers of the application will fill out a series of survey questions via property controls, just like last week. The questions this week ask about types of users in a customer's deployment of Spotfire. When the consumer fills in the values to all the questions, the Spotfire file will calculate the recommended amount of training needed for that company and display a breakout of recommended training, by user role.

    To accomplish this, first, we have to load a data table into TIBCO Spotfire. In our scenario, there is just 2 columns: the different user roles in TIBCO Spotfire deployments and how many days of training they typically require.

     

     

    Then we need to create our survey questions. We do this inside a Text Area visualization using text and property controls and some HTML to create the table layout.    

     

    To connect the property controls with the data table, we now need to add a calculated column.  This calculated column will multiply the number of training days required for a given user role (using the ‘Pathway Days’ column) with the value entered  in the corresponding property control.  This will ultimately create a new calculated column which displays the total number of training units required  for each user role.  The column values will automatically get updated when the user updates values in the property controls.  The complete expression used is shown below: 

     

      case [Role]
    when "Administrator" then ([Pathway Days]*${NumAdminRole})
    when "DBA" then ([Pathway Days]*${NumDbaRole})
    when "Developer Basic" then ([Pathway Days]*${NumDevRole})
    when "Developer Advanced" then ([Pathway Days]*${NumDevAdvancedRole})
    when "Analyst" then if (${NumAnalystRole} > 10,(Ceiling(${NumAnalystRole} / 12) * 8 *[Training Days (per student)] ), if ("${nbrNeedExpressions}"="Yes",(([Pathway Days]+1)*${NumAnalystRole}), (([Pathway Days])*${NumAnalystRole})))
    when "Author" then ([Pathway Days]*${NumAuthorRole})
    when "Business User" then ([Pathway Days]*${NumBusRole})
    else 0
    end
     We then add our analysis on another page in the Spotfire file which will show us the results and recommendations.  

     

    Want to see it in action? Visit it here. 

     

Syndication

Other Spotfire Blogs

©Copyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center