Conditional formatting and Icon Sets offer a great way to highlight important information or visually alert you when something needs attention. This article outlines how to add conditional formatting rules to a diagram so you can highlight shapes with stylistic elements and icons.
| Free | Individual | Team | Enterprise | |
Create a new rule
When you create a new conditional formatting rule, it will automatically evaluate all of the shapes in your diagram to see if they match your conditional formatting criteria.
If you want the conditional formatting to only apply to certain shapes, start by selecting the shapes you would like Lucidchart to include in your conditional formatting.
To create a conditional formatting rule:
- Click
the Conditional Formatting icon from the Primary Toolbar at the far left-hand side of the canvas.
- Click + Add rule.
- Type a name for the rule.
- Select "If" conditions.
- Select "Then" conditions.
- Click Save.
After you create your first rule, you can add additional rules by clicking the + that appears at the top of the conditional formatting menu.
For more detail on "If" and "Then" conditions, read the sections below.
Tip: Save time by creating your conditional formatting rules with AI. Learn more in our Boost productivity with Lucid AI in Lucidchart article.
Add conditions to a rule
To create an “If” condition, choose one of the following options from the dropdown menu under "If":
Shape type
With shape type as a condition, Lucidchart looks at the type of shape or object used in your diagram to determine formatting.
Choose "Is" or "Is not", and check the box next to one or more shape types from the dropdown.
Connected shapes
With connected shapes as a condition, Lucidchart looks at the number of shapes an object is connected to in your diagram to determine formatting.
Choose a condition such as "Is greater than", "Is less than", or "Is equal to", and specify the number value you want Lucidchart to look for.
Text
With text as a condition, Lucidchart looks at text on the shapes in your diagram to determine formatting.
Choose from one of four conditions (“Contains”, “Does not contain”, “Is empty”, or “Is not empty”), and specify the value you want Lucidchart to look for.
Shape data
With shape data as a condition, Lucidchart looks at data or information associated with the shapes you selected to determine formatting.
When you select Shape data as the condition, a dropdown menu appears where you can select which data you want Lucidchart to check your condition on. You can choose from a list of columns in your data set.
Once you’ve selected your shape data, choose an option from the dropdown such as "Is greater than", "Is less than", or "Is empty", then specify the value you want Lucidchart to look for.
Shape location
With Shape is inside as a condition, Lucidchart looks at whether a shape is or is not contained inside a swim lane or other container to determine formatting.
When you select Shape location as the condition, a dropdown menu appears where you can select which container you want Lucidchart to check your condition on. You can choose from any containers present on the canvas.
Formulas
With formulas as a condition, you can use Lucidchart formulas to customize what is formatted.
When you select Formula as your condition, you’ll see a field appear where you can type in your formula.
Learn more: To see an example of each type of "If" condition, check out this post from the Lucid Community.
Add an “And” or an “Or” condition (optional)
Click + Add condition. An “And” condition will allow you to specify that both the “If” and the “And” conditions must be met before the formatting is applied.
- For example, you could highlight employees with roles that say “Intern” AND “Engineering” to draw attention to the Engineering Interns specifically.
Adding an “Or” condition allows you to specify a second condition that, if true, triggers the same formatting as your “If” condition.
- For example, you could highlight employees with roles that say “PM” OR “Product” - to show all employees with PM or Product roles.
“And” and “Or” conditions have the same fields and the same layout as “If” conditions.
Select your formatting
In the “Then” section, you can select from three formatting options:
Shape style
If you select Shape Style, you can click Styles to select a preset theme style or click Custom to customize your formatting from the following options: shape fill color, border color, text color, line color, border style, line style, border width, and/or line width.
Icons
If you select Icons, you can choose an icon to appear on the shape (icons from Lucidchart’s library, a text badge, or a custom icon upload), adjust the style, add hover text (optional), and change where the icon appears on the shape.
Dynamic Shapes
If you select Dynamic Shapes, you can specify the color that fills the shape, the color of the background of the shape, and then specify the parameters for the value of your shape. You can also use shape data or formulas to specify the min and max.
In the “Value” section, select the value that you want the shape to reflect.
- For example, if the value field contained the number 70, your progress bars will all show 70% completion. Instead of choosing Custom number as the value source, you can use shape data or a formula to specify this number so that it is unique to each shape.
Add an “Else” or an “Else If” condition (optional)
Add an “Else” or an “Else if” condition if you would like to apply formatting to the shapes in your selection that do not meet the conditions that you specified above. You can set “Else” and “Else if” conditions the same way that you set your “If” conditions.
Here’s an example of an “ELSE” condition that changes the shape style to be pink if the “If” conditions aren’t met.
Show or hide conditional formatting rules
Once your rules have been created, you can use the eye icon in the conditional formatting menu to hide or show your rules.
To hide all your rules at once, select the eye icon at the top of the menu next to “My Rules”. To hide a particular rule, click
the eye icon next to the specific rule title.
Tip: When a rule is hidden, the eye icon becomes crossed out. Click the crossed-out eye icon to have a rule appear again.
Manage conditional formatting rules
Once your rule has been created and saved, it will appear in a list in the conditional formatting menu. This list appears whenever you click on the wand icon, and are not editing a specific rule. From your list of rules, you can Rename, Edit, Duplicate, or Delete rules by clicking on the three dots to the right of the rule and selecting from the options. You can also Unapply the rule from here.
In addition to using the menus to edit rules, you can drag and drop rules in this list to apply or unapply a rule to different selections in your diagram. For example, if I created a rule to apply to some shapes, I can adjust it to apply to all shapes by dragging it to the “Applied to All Shapes” section.
To see which shapes a rule is applied to, you can hover over a rule, and the shapes the rule applies to will be highlighted.
Add or remove an icon from a shape
Using Icon Sets, you can add an icon to one or more shapes on the canvas without setting up a conditional formatting rule. To add an icon, follow these steps:
- Select one or more objects on the canvas.
- Click
the Icon Sets icon from the Formatting bar at the top of the workspace.
- Select an icon from the "Icon" dropdown menu.
- From this panel, you can also change the color of the icon and the position of the icon relative to the object or objects you selected.
To remove an icon:
- Select one or more objects on the canvas that contain an icon.
- Click
the Icon Sets icon from the Formatting bar at the top of the workspace.
- Select the "Icon" dropdown menu.
- Click Remove Icon.
FAQ
Can I use Actions to toggle my conditional formatting rules?
Yes. You can set up an action to toggle conditional formatting rules on and off. This action can be assigned to a specific shape of your choice. Once the action is set up, the shape will function as a button with which you can use the hotkey (Command + Shift + Click for Mac, and Ctrl + Shift + Click for PC) to toggle the rules on and off. For instructions on setting up this action, refer to our Actions article.
How can I add a legend?
To create a color-coded legend, use the Diagram Key shape. Here’s how:
- Locate the Standard shape library in the Shape menu.
-
Drag
the Diagram Key shape onto the canvas.
For more information about how to Add a diagram key in Lucidchart, check out our article.
Conditional formatting uses IF → THEN (optional: → ELSE) syntax for inputting rules.
How can I tell which shapes my rule applies to?
To the right of every rule name, there is a gray indicator that shows how many out of the total number of shapes a rule applies to (30/30 in the example below). When you hover over the rule in the list view, the shapes that the rule is applied to will also light up on the canvas.
Why do all of my shapes have an icon that I am unable to remove?
You or a collaborator may have added icons using the Icon Sets feature. To remove them, follow the steps listed in the Add or remove an icon from a shape section above. If this doesn't work, you can also check to see if you have any conditional formatting rules that are being applied to the shape or shapes.
Resources
To learn more about this feature, explore the additional resources below. These resources are available in English only.
Videos
Give feedback on this article
Have feedback about this article? Tell us about your experience here.