Skip to content

12.4 Sequential Rules

Sequential Rules apply formatting in a repeating pattern rather than based on data values. They're perfect for creating alternating row colors in tables, defining color progressions in pie charts, or establishing visual rhythms that make your dashboards easier to scan and more visually appealing.

Unlike Conditional Rules that ask "does this value meet a threshold?", Sequential Rules simply rotate through a list of formats: first item gets format 1, second item gets format 2, third item gets format 1 again, and so on.

How Sequential Rules Work

A Sequential Rule contains a list of sequence steps—each step defines a Style object (and optionally a Shape object) to apply. Datashop applies these steps in order to each element in your visual:

  1. First element (row, bar, segment, etc.) receives sequence step 1's formatting
  2. Second element receives sequence step 2's formatting
  3. Third element receives sequence step 3's formatting
  4. ...and so on until all steps are used
  5. When the list is exhausted, it starts over from step 1

Example: A Sequential Rule with two steps (white background, light gray background) applied to a table: - Row 1: White background (step 1) - Row 2: Light gray background (step 2) - Row 3: White background (step 1—pattern repeats) - Row 4: Light gray background (step 2) - Row 5: White background (step 1) - And so on...

Two-step Sequential Rule creating alternating row colors for improved readability

There are no operators, no conditions, no thresholds—just a simple repeating sequence. This makes Sequential Rules straightforward to create and predictable in behavior.

Sequence Steps vs. Conditions

It's important to understand that sequence steps are not conditions in the traditional sense: - They have no operators (no <, >, =, between) - They have no range values to compare against - They don't evaluate data—they simply apply formatting in order

Each sequence step contains: - A Style object with formatting properties (colors, fonts, borders, etc.) - Optionally, a Shape object (though shapes are less common in Sequential Rules)

Because there's no condition evaluation, sequence steps never overlap or merge. Each element gets exactly one step's formatting.

Common Applications

Alternating Row Colors (Tables)

The classic use case: improve table readability with subtle color alternation.

Two-step pattern: - Step 1: White background - Step 2: Light gray background (#F0F0F0)

Simple two-color alternation makes dense tables easier to scan

Three-step pattern for grouped data: - Step 1: White background - Step 2: Light blue background - Step 3: Light gray background

This creates a visual rhythm that helps users track across wide tables.

Pie Chart Color Sequences

Define the color progression for pie slices to match your brand or improve contrast.

Five-step corporate color pattern: - Step 1: Primary brand color (e.g., blue) - Step 2: Secondary brand color (e.g., teal) - Step 3: Accent color 1 (e.g., orange) - Step 4: Accent color 2 (e.g., yellow) - Step 5: Neutral color (e.g., gray)

Sequential Rule ensures consistent color ordering across all pie charts

As the pie chart renders slices, they're assigned colors from this sequence in order. If there are more than five slices, the pattern repeats.

Bar Chart Color Patterns

Apply repeating color patterns to bars in a bar chart.

Example: Quarterly comparison with two colors - Step 1: Dark blue - Step 2: Light blue

This creates a visual grouping effect that helps distinguish individual bars while maintaining cohesion.

Two-color pattern applied to bars enhances visual distinction

Line Chart Segment Colors

In line charts with multiple series, Sequential Rules can define the color for each line.

Example: Multi-region sales trends - Step 1: Blue line - Step 2: Green line - Step 3: Orange line - Step 4: Red line

Each region's line receives the next color in the sequence.

Creating Sequence Steps

When building a Sequential Rule, focus on creating a visually harmonious pattern:

For readability (alternating rows): - Use subtle color differences (white and light gray, not white and dark blue) - Avoid colors that imply meaning (don't use red/green for simple alternation) - Test with actual data density—what works for 10 rows may overwhelm 100 rows

For brand consistency (pie charts, bar charts): - Use colors from your Corporate Colors system Rule (see 12.5 System Rules) - Ensure sufficient contrast between adjacent colors - Order colors intentionally—place your primary brand color first

For data distinction: - Use more saturated colors for emphasis - Create visual grouping with color families (shades of blue, then shades of green) - Test color-blind accessibility with tools like Coblis

Sequential Rules in Different Visual Types

Visual Type Sequential Rule Applies To Common Use
Table Rows Alternating row colors for readability
Bar Chart Bars (individual items) Color patterns for visual distinction
Pie Chart Slices Brand-consistent color progression
Line Chart Series (lines) Distinct colors for each line
Column Chart Columns (individual items) Color patterns for visual grouping

[!NOTE] Sequential Rules don't work in gauge visuals, as gauges don't display multiple items.

Practical Example: Customer List Table

Scenario: You have a table showing customers with columns for Name, Turnover, Profit Margin, and Last Order Date. The table has 50 rows and is difficult to scan across wide columns.

Solution: Create a Sequential Rule with two steps: - Step 1: Background color #FFFFFF (white), no other formatting - Step 2: Background color #F5F5F5 (very light gray), no other formatting

Apply the Rule to the entire table visual. Result: Every other row has a subtle gray background, making it far easier to track across columns.

Sequential Rule transforms a dense table into a scannable, professional layout

Best Practices

Keep it simple: Two or three sequence steps are usually sufficient for alternating patterns. More steps can create visual noise rather than clarity.

Prioritize subtle over bold: For alternating rows, use colors that differ by only 5-10% brightness. Bold color differences work for pie charts but overwhelm tables.

Align with system Rules: When creating Sequential Rules for charts, use colors defined in your Indicator Colors or Corporate Colors system Rules. This ensures consistency across dashboards.

Test at scale: A pattern that looks good with 5 items may become overwhelming with 50 items. Always test your Sequential Rules with realistic data volumes.

Remember they don't merge: Unlike Conditional Rules, sequence steps never combine or overlap. Each element gets exactly one step's formatting, so design each step to be complete.

Tips – Sequential Rules

  • Start with a two-step pattern for alternating rows—it's simple and universally readable.
  • Use your organization's Corporate Colors for pie chart sequences to maintain brand consistency.
  • Sequential Rules are ideal for static formatting patterns. If formatting needs to change based on data values, use Conditional Rules instead.
  • You can combine Sequential and Conditional Rules on the same visual. For example, alternate row colors with a Sequential Rule while highlighting negative values with a Conditional Rule.

Common Issues – Sequential Rules

Problem: Pattern doesn't start where I expected (e.g., second row is white instead of gray)

  • Solution: Sequential Rules always start with step 1 on the first element. If you want the pattern to start on a different step, reorder the sequence steps in your Rule definition.

Problem: Colors are too bold and make the table hard to read

  • Solution: Reduce color saturation and brightness differences. For alternating rows, aim for colors that differ by less than 10% in brightness. Use tools like a color picker to find subtle variations.

Problem: Pattern breaks when filters change

  • Solution: This is expected behavior. Sequential Rules apply to visible elements only. When you filter data, the pattern reapplies from step 1 to the new first element. This isn't a bug—it's how Sequential Rules work.

Next Steps

12.5 System Rules