Conditional Data Bar macro draws an in-cell bar whose length is proportional to the cell’s numeric value, relative to the specified minimum and maximum of the range. This macro must be used inside Conditional Rules Manager macro.

New! Datacenter Only

Conditional Data Bar macro does the following:

  1. computes each cell’s value as a percentage of the way from Minimum value to Maximum value, as defined by the Minimum value type/Maximum value type parameters;
  2. draws a bar inside the cell, filled to that percentage, in Bar color;
  3. for negative values, the bar grows from zero toward the left instead, in Negative bar color – the same way Excel’s own data bars handle negative values;
  4. optionally shows the cell’s original value as text alongside the bar, controlled by Show value.

 

Conditional Data Bar macro has the following parameters:

Parameter Description
[Enum] Minimum value type (default='Lowest value') The type of the minimum value to be used. Based on this type Minimum value parameter value may have to be specified. May have one of the following values:
  • Lowest value
    • Means, that the minimum value of all the values in the range should be used
    • If Minimum value type is “Lowest value”, the Minimum value parameter value is ignored
  • Number
    • Means, that the specified number should be used
    • In this case the number should be specified as Minimum value parameter value
  • Percent
    • Means, that the value, which is the minimum of all the values in the range plus the difference between maximum and minimum value multiplied by the number of percents should be used
    • The number of percents is specified in Minimum value parameter
[String] Minimum value (default=empty) The value parameter – either constant or percent value should be specified, based on the Minimum value type parameter value.
[Enum] Maximum value type (default='Highest value') The type of the maximum value to be used. Based on this type Maximum value parameter value may have to be specified. May have one of the following values:
  • Highest value
    • Means, that the maximum value of all the values in the range should be used
    • If Maximum value type is “Highest value”, the Maximum value parameter value is ignored
  • Number
    • Means, that the specified number should be used
    • In this case the number should be specified as Maximum value parameter value
  • Percent
    • Means, that the value, which is the maximum of all the values in the range plus the difference between maximum and minimum value multiplied by the number of percents should be used
    • The number of percents is specified in Maximum value parameter
[String] Maximum value (default=empty) The value parameter – either constant or percent value should be specified, based on the Maximum value type parameter value.
[String] Bar color (default='#638ec6') The color of the bar for non-negative values. Standard CSS color names, Confluence highlight color names and colors in HEX notation (#rrggbb) are supported.
[String] Negative bar color (default='#ff555a') The color of the bar for negative values. Standard CSS color names, Confluence highlight color names and colors in HEX notation (#rrggbb) are supported.
[Boolean] Show value (default=true) Specifies whether to show the cell’s original numeric value as text alongside the bar. Supported values are true (default) and false.
[String] Applies to (default='All tables') Specifies the cells to apply conditional formatting to.
  • Set to 'All tables' to apply formatting to all cells of all tables.
  • An exact column range may be specified to apply formatting to the specified columns only. Note, that exact Table specificator should also be specified. Example: 'Table1.A:B'.
  • Several ranges may be specified, separated with ';' symbol. Example: 'Table1.A:B; Table1.D:E'.

When the parameters are set, an example of the data bars, filled from Minimum value to Maximum value, may be seen at the preview pane of the macro editor. Press “Preview” button after changing parameters to see the result.