Skip to content

Card Widget

Introduction

The Card Widget is a versatile display component designed to highlight a single, important metric or key performance indicator (KPI). It provides a clear, concise visual representation of a specific data point, often accompanied by a title, conditional formatting, and even an optional image.


Purpose

This widget is ideal for drawing immediate attention to critical numbers, such as total sales, average ratings, or conversion rates. It allows for extensive customization of its value, title, and appearance, making it a powerful tool for summarizing essential information at a glance.


Steps to Add and Configure the Card Widget

  1. Add Widget: From the left-side widget panel, click the Card Widget icon.

    Card Widget

  2. Widget Block Appears: A new widget block will be added to your canvas.

    Card Widget

  3. Select a Dataset: From the Datasets (ds) dropdown, choose the dataset you want to use (e.g., swiggy.ds).

    • Drag a column (e.g., Restaurant Name) from Available Columns into the Field section.

    • Use the ⚙️ icon to apply aggregation functions such as Sum, Count, Average, Min, Max.

      Card Widget

  4. Configure the Card: Expand the Title, Value, Conditional Formatting, and Image sections to customize the widget.

  5. Preview the Widget: The right-hand panel will update to show the configured card with your selected field and formatting.

  6. Publish: Once satisfied, click Publish (top-right corner) to finalize the widget for your report/dashboard.


Field Configuration

The Field section defines which data column the card widget will display.

OptionDescription
Datasets (ds)Select the dataset you wish to use from the dropdown (e.g., swiggy.ds).
Drop column hereDrag and drop a column from Available Columns into this area.
⚙️ Icon (Settings)Apply aggregation functions such as Sum, Count, Average, Min, Max.
PathIndicates the path to your selected dataset.
Client Script (f(x))Open a script editor for advanced data manipulation or custom calculations.

Title Configuration

The Title section allows you to define and style the text that accompanies your metric.

OptionDescription
TextEnter the desired title for your card (e.g., “Total Sales,” “Average Rating”).
Title PositionChoose where the title appears relative to the value (e.g., Top, Bottom).
Title AlignSet the horizontal alignment of the title (e.g., Left, Center, Right).
Font FamilySelect the font for the title text (e.g., DIN, Arial, Tahoma).
Font SizeAdjust the size of the title text (e.g., 12, 16).
Font WeightSet the boldness of the title text (e.g., Normal, 700/Bold).
ColorChoose the font color for the title.
Background ColorSet a background color for the title area (e.g., transparent, #FFFFFF).
Padding (px)Adjust the internal spacing around the title text.
Margin Bottom (px)Control the space below the title.
HyperlinkAdd a clickable URL to the title.

Value Configuration

The Value section focuses on styling and formatting the main numerical display of your card.

OptionDescription
Font FamilySelect the font for the displayed value.
Font SizeAdjust the size of the value text (e.g., 32).
Font WeightSet the boldness of the value text (e.g., 700/Bold).
ColorChoose the font color for the value (e.g., #000000/Black).
Background ColorSet a background color for the value area (e.g., transparent).
Decimal PlacesDefine how many decimal places to show for the value (e.g., 2).
Thousand SeparatorToggle to enable/disable thousand separators for large numbers.
Display UnitAutomatically or manually set units for large numbers (e.g., Auto, K, M, B).
PercentageToggle to display the value as a percentage.
PrefixAdd text before the value (e.g., currency symbol like ’$’).
SuffixAdd text after the value (e.g., unit like ‘units’).
Padding (px)Adjust the internal spacing around the value.
Margin Bottom (px)Control the space below the value.
AlignSet the horizontal alignment of the value (e.g., Center).

Conditional Formatting

Conditional Formatting allows you to dynamically change the appearance of the card’s title or value based on specific rules.

OptionDescription
Formatting OnChoose whether the conditional formatting applies to the Title, Value, or Background.
f(x)Click this to open the conditional formatting rule builder.
Column NameSelect the column used to evaluate the rules (e.g., Category).
AddClick to add a new formatting rule.
If ValueDefine the condition (e.g., Equal, Greater than, Less than).
ValueEnter the value to compare against.
UnitsSelect the display unit for numbers (e.g., None, K (Thousands), M (Millions), B (Billions), T (Trillions)).
Rule TypeChoose what property to change (e.g., Color).
Color / Font Family / Font Weight / Font SizeSpecify the styling to apply when the condition is met.
SaveClick to save your conditional formatting rules.

Image Configuration

The Image section allows you to embed an image within your card widget.

OptionDescription
Use ImageToggle this switch On to enable image functionality.
Image PathSelect the image file you want to display.
Image WidthSet the width of the image in pixels.
Image HeightSet the height of the image in pixels.
Image PositionChoose the image’s placement relative to the text (e.g., Left, Right, Top, Bottom).
Margin Top (px)Control the space above the image.
Margin Right (px)Control the space to the right of the image.
Margin Bottom (px)Control the space below the image.
Margin Left (px)Control the space to the left of the image.
TextAdd a descriptive text for the image (optional).
SplitterToggle this to add a visual separator between the image and text.

Example: Conditional Formatting

You can apply Conditional Formatting on the Rating field to highlight restaurant performance dynamically.

Steps

  1. Expand the Conditional Formatting section.

  2. Choose to format: Value.

  3. Click fx to open the rule editor.

  4. Define rules such as:

    FieldExample
    Column NameRating
    If ValueGreater Than or Equal To
    Value4.0
    Rule TypeColor
    ColorGreen
    Font Size32
  5. Add another rule for ratings below 4.0:

    FieldExample
    Column NameRating
    If ValueLess Than
    Value4.0
    Rule TypeColor
    ColorRed
    Font Size32

    Card Widget

  6. Click Save.


Result

  • If the Top Rating ≥ 4.0, the card value (e.g., 4.3) will appear in Green.
  • If the Top Rating < 4.0, the card value will appear in Red.

This ensures your Card Widget always provides instant visual feedback on restaurant performance, even when only one record (top-rated restaurant) is returned from the dataset.