Jump to content
We've recently updated our Privacy Statement, available here. ×
  • Donut plot in Spotfire®


    A Donut plot is an alternative to a pie chart, and it is sometimes seen as more visually attractive than a regular pie chart. It also has some space in the middle for presenting a number. There is no out-of-the box donut chart in Spotfire®, but if you are in real need of one, you can create it by cleverly configuring a map chart.

    Donut chart is now available as a visualization mod for Spotfire® available to download from the Spotfire Community Exchange.


    Introduction

    A Donut plot is an alternative to a pie chart, and it is sometimes seen as more visually attractive than a regular pie chart. It also has some space in the middle for presenting a number. There is no out-of-the box donut chart in Spotfire®, but if you are in real need of one, you can create it by cleverly configuring a map chart. Thanks to Christophe Verdon of Renault for sharing his creative thinking in the Spotfire® Ideas portal.

    converted-file.thumb.png.3a8d66ec56e5c23f2dbfe81b0967b085.png

    Note that while this is an unorthodox configuration of a map chart, the end result is as dynamic as one would expect from any Spotfire visualization ? the donut plot responds to filtering, marking, brushlinking with other visualizations, and it can be used as a master-detail visualization.

    Now, let's see how to configure the map chart so it becomes a donut plot.

    Solution

    Start by creating a map chart. Typically, you get a default configuration with a map of the world. Then, do the following:

    1. Remove the map background by deactivating it in the Layers control, in the top left part of the map chart.

    2. Open the Properties for the data layer containing your markers (right-click the map and select Properties, go to Layers, select the data layer (which must be a marker layer and not a feature layer) and click Settings). In the Positioning section, make sure positioning is set to Coordinate columns, and then, instead of selecting any columns, just type 1, or any fixed value you like, both for X and Y (as a custom expression). This should render a single marker (make sure "Marker By" is set to "(None)") in the visualization.

      converted-file.png.83d9221842f12a1120452f177a512b89.png

    3. Now let's create the pie: In the Shape section of the marker layer settings, select "Pies" and select the measure to control the sector sizes with. Also, in the Colors section, select what categorical column that should define the sectors. Take the time to name this layer "Pie" or something else, to distinguish it from the next layer we are going to create. To make your pie bigger, use the slider in the Size section of the layer properties and adjust the size to your liking.

      You should now have something like this:

      converted-file.thumb.png.6dd830928dffb29a29409673c0e5cdc2.png

    4. At this point, we have something that looks like a pie chart, but we will now turn it into a donut by adding another marker layer with a single white marker on top of the pie. Add the new marker layer using the same technique for positioning as for the first layer, but let it be a normal marker layer, without the Pies shape. Name it "Disk", or something else that lets you distinguish it from the pie layer. Set its color to white. Remove any column on the Size axis, and manually adjust the size using the slider, until it has the appropriate size to give the appearance of a donut.

      converted-file.png.9c385a83544c6d3ab43910037d6014a9.png

    5. If you want to show a number in the center of the Donut, add a label column and select Center labels on items. Note that you can concatenate text and values in the label by using a custom expression such as: "Total Sales: " & Sum([sales])

    donut_mapcharts_sales_and_marketing.zip


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...