How to Remove Conditional Tick Marks in Deneb Vega-Lite Charts
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.

- 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.
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.
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.
Navigate to your Power BI report canvas, select your custom visual, and click on the 'Edit' button to open the Deneb Advanced Editor.
Scroll through your JSON specification to find the 'axis' object nested within your 'x' or 'y' encoding block.
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.
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.

Seek Specialized Community Assistance
Because the exact expression heavily depends on your specific data and chart specification, consulting the Power BI community can provide an exact JSON fix.
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. Download and Install: Get WPS Office for free from the official website and complete the quick installation process.
- 2. Import Your Data: Open WPS Spreadsheet and easily open your existing Microsoft Excel datasets or CSV files.
- 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.

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.




