Conditional Formatting - Profitbase/PowerBI-visuals-Gantt GitHub Wiki
Conditional formatting allows you to highlight key data in your Gantt chart by defining custom rules to style specific elements or applying color scales to visualize performance dynamically. These options are configured within Edit Mode:
How to Create a Ruleset
To create a conditional formatting rule, follow these steps:
Step 1: Name the rule
Give your rule a clear, descriptive name.
Step 2: Select the rule color
Choose the color you want to apply when conditions are met.
Step 3: Select hierarchy level
Choose where in your hierarchy the formatting should apply (Parent, Child, Both, or Custom (New in Gantt v3.1)).
Step 4: Select the target element
Choose which part of the visual the formatting applies to (Taskbar, Milestones, or Data grid).
Step 5: Configure specific properties
Depending on the target chosen in Step 4, specify options such as applying the color to the text or background.
Step 6: Add the condition(s)
Define the logic of your rule. All fields currently used in the visual can be used to set conditions.
Step 7: Save
Click Save to apply the rule.
Example: Highlighting a Specific Manager
In the example below, the ruleset "Anders" is set to apply a yellow background color to the Manager column in the data grid at the TaskName hierarchy level. The yellow highlight is applied only to cells where the Manager field contains the name "Anders".
How to Create a Color Scale
You can also dynamically shade elements using a gradient scale:
Step 1: Name the scale
Give your color scale rule a unique name.
Step 2: Select the base field
Choose the field to drive the color scale. Note that the field must be a numeric value; text or string fields cannot be used for color scales.
Step 3: Select formatting targets
Choose the visual elements to style (Data grid, Taskbars, or Milestones).
Step 4: Choose target property
For the data grid, select whether to style the Font color or Background color.
Step 5: Select color scheme type
Pick your gradient style (e.g., Diverging or Sequential).
Step 6: Set ranges and colors
Choose how many color ranges to show and define the colors for the minimum and maximum ranges.