logo
search
Chart & Visualization Issues

How to Remove Conditional Tick Marks in Deneb Vega-Lite Charts

Emma BrownEmma Brown Sep 30, 2026 869 views

Question details

The user wants to remove or hide tick marks on the axis of a Deneb Vega-Lite chart when there is no corresponding axis label displayed.

How to Remove Conditional Tick Marks in Deneb Vega-Lite Charts
Product
Power BI / Deneb Vega-Lite
Device & OS
not provided
Scenario
Creating custom data visualizations using the Deneb custom visual in Power BI, where axis labels are conditionally hidden using expressions.
Observed behavior
Conditional label expressions successfully hide the text labels, but the tick marks remain visible on the axis where no label exists, causing a visual misalignment.
Before you start

Copy your current Vega-Lite JSON specification into a plain text editor before adjusting the axis configurations, ensuring you have a backup if the visual breaks during editing.

Solution 1Recommended

Configure Conditional Axis Encoding Separately

Use specific conditional logic within the Vega-Lite axis properties to synchronize the rendering of tick marks with your text labels.

In Vega-Lite, labels and tick marks are treated as separate visual elements. A conditional expression applied to a label only affects the text string. To completely remove the tick mark, you must configure the tick properties or scale domains directly.

1
Open Deneb Advanced Editor

Navigate to your Power BI report canvas, select your custom visual, and click on the 'Edit' button to open the Deneb Advanced Editor.

2
Locate the Axis Configuration

Scroll through your JSON specification to find the 'axis' object nested within your 'x' or 'y' encoding block.

3
Apply Tick Configuration

Instead of only using 'labelExpr' to hide text, modify properties like 'tickCount', 'values', or conditionally adjust the 'tickSize' property to ensure tick marks do not render where labels are absent.

4
Apply and Verify Changes

Click the 'Apply' button in the Deneb editor. Check the visual preview to ensure that gridlines, labels, and ticks are now properly synchronized and aligned.

Configure Conditional Axis Encoding Separately
Understanding Vega-Lite Logic: Because labelExpr only evaluates the text output, an empty string still technically constitutes a label, meaning the tick mark will still be drawn by the rendering engine.
Free Microsoft Office alternative

Simplify Data Visualization with WPS Office

Dealing with complex JSON specifications in Power BI can be frustrating and time-consuming. For straightforward, powerful data visualization and everyday reporting, WPS Spreadsheet offers an intuitive charting interface that perfectly replaces Microsoft Excel. It handles your data effortlessly, requires zero coding, and is completely free.

  1. 1. Download and Install: Get WPS Office for free from the official website and complete the quick installation process.
  2. 2. Import Your Data: Open WPS Spreadsheet and easily open your existing Microsoft Excel datasets or CSV files.
  3. 3. Insert a Custom Chart: Select your data range, navigate to the 'Insert' tab, and click 'Chart' to instantly generate professional visualizations with perfectly formatted axes.
Intuitive chart builder with no coding or JSON scripting requiredSeamless compatibility with all Microsoft Excel (.xlsx, .xls) file formatsLightweight application that runs smoothly on Windows, Mac, and LinuxExtensive built-in chart templates for quick and professional data visualization
microsoft office alternative - wps office

Frequently Asked Questions

Why do tick marks appear without labels in Vega-Lite?

In Vega-Lite, labels and tick marks are separate visual components rendered independently. A conditional expression that hides a label only affects the text string itself, leaving the underlying tick mark rendered unless explicitly hidden.

Can I use the labelExpr property to remove tick marks?

No, the labelExpr property is used solely to format or conditionally render the text of the axis labels. To remove tick marks, you must adjust specific tick properties, such as tickSize or tickCount, or manually define the axis values.

Where can I find examples of Deneb axis configurations?

You can find example JSON configurations in the official Vega-Lite documentation, on the official Deneb website, or by searching the Power BI Community galleries for custom visual templates.