Skip to main content
Skip Navigation LinksHome  Extending the Spotfire Platform  Common Tasks and Idioms  Spotfire Axis Formatting

©Spotfire 2011

Spotfire Axis Formatting

Axes formatting can be locally overridden in graphical visualizations and in the cross table. The short number formatting enables the use of magnitude symbols to minimize the space consumed.

Available from Spotfire 2.2.

Axis Formatting

The Formatting class

Axis formatters are primarily used to set the formatting of axis scale labels. Each axis is associated with at least one scale, that is one line with tick marks and labels along an axis in a visualization. Usually one formatting per axis selector is set. When two or more axis selectors share a scale with scale labels they also share formatting. There are two exceptions:

  • The built-in percent scales used in line charts, bar charts and parallel coordinate plots have no axis formatting.
  • All other axes of parallel coordinate plots have formatting.
Related API Documentation

Cross Table Formatting

Formatting can be set on the cross table rows and columns. A row or a column is either a grand total, or defined by a group of data columns. The groups to format by can be defined in either of two ways:

  • Formatting by category means formatting by one of the data columns on the row or the column axis. Each group can have its own formatting
  • Formatting by measure means formatting by the columns on the measure (cell value) axis. Every measure can have its own formatting

Indexed Properties

Multiple formatters, accessed by a data type and a CategoryKey based on the column or category being formatted, can be set for a single scale or a single cross table. The empty category key represents all columns or categories: It overrules all column formatting, but is itself overruled by formatting with non-empty category keys. Category keys remain unless explicitly removed.

Indexed formatting is used in three cases:

  • When multiple scales are used, the scale can hold a formatter for each scale.
  • In parallel coordinate plots each axis can have a separate formatting. Since there is only one non-percent scale, the right scale, it will use indexed properties to hold values for the other axes.
  • In cross tables a formatter for each measure column, or for each category in a column or row axis column, can be held. The category keys identify formatting based on parts of expressions. When formatting by measure, category keys with the measure is saved. When formatting by category, the data column defining the formatting groups is specified in the formatting property page.

Formatting Precedence Order

The following axis formatting type list shows the order of precedence for formatting, some outlines of the corresponding code, and, if applicable, how the setting is applied in the UI:

  1. Indexed Axis Formatting
    scale.IntegerIndexedFormatter["Sales"] = f;
    crosstable.RealIndexedFormatter["5-LOW"] = f;
    Set in scale and cross table context menus, or the formatting tab of the visualization property page.
  2. Root Axis Formatting
    scale.CurrencyFormatter = f;
    crosstable.DateTimeFormatter = f;
    Set in scale context menus, or the formatting tab of the visualization property page.
  3. Data Column Formatting
    dataColumn.Properties.Formatter = f;
    Set in the Edit > Column Properties > Formatting tab.
  4. User Preferences
    Set in the Tools > Options > Axis Formatting tab.
  5. Plot Default
  6. Data Type Default
User Documentation

Short Number Formatting

Short number formatting in use

Short number formatting is only combined with the Number and Currency number formatter categories. In the Currency case both magnitude symbols and currency symbols are shown.

Short number formatting minimizes the space used by replacing factors with magnitude symbols. Named lists of factor and magnitude symbol pairs are stored in a preference object. The Standard default list has M for million and k for thousand. Unless the user has specified a magnitude symbol for 0, the empty string is added as magnitude symbol for the magnitude 0.

If decimal length is set with DecimalDigits, the short number formatting will obey that setting. If the decimal digits are set to automatic mode, the number of decimals will be limited to the ones required to represent the value correctly.

API Documentation

Examples

  • Line Chart with Individual Scaling
    This example creates a line chart with individual scaling. The left scale is formatted as a number with two decimals and the right scale is formatted as a number with no decimals.
  • Cross Table with Measure Formatting
    This example creates a cross table where a measure has been formatted as currency.
  • Short Number Formatting
    This example creates a formatter that uses short number formatting with auto decimals together with currency. A new symbol scheme is created and applied to the short number formatting.