How to Programmatically Display Category Names in Modern Chart Labels
Question details
The user wants to use code to configure data labels in a modern chart to display X-axis category names instead of data-point values, and is looking for a way to trigger chart reload events.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Customizing data labels and handling events via VBA or scripts for modern chart types (such as Treemap, Sunburst, or Waterfall).
- Observed behavior
- Modern charts lack a built-in programmatic method in the object model to replace default data values with category names, restricting automation.
Determine whether you are using a standard chart (e.g., Column, Bar, or Pie) or a 'Modern Chart' (e.g., Waterfall, Sunburst, or Histogram), as their programmatic capabilities via VBA differ significantly.
Use Standard Charts as a Programmatic Workaround
Since Modern Charts currently restrict VBA access to data labels, use standard charts (like Clustered Column or Stacked Bar) if you must automate the display of category names.
The Excel Object Model has not yet fully exposed data label properties for Modern Charts introduced in Office 2016. Standard charts, however, offer full programmatic access to label properties.
Right-click your existing Modern Chart, select 'Change Chart Type', and choose a standard alternative like a Clustered Column or Bar chart.
Click on the chart series, then click the '+' icon (Chart Elements) next to the chart and check 'Data Labels'.
To format manually, right-click the labels, select 'Format Data Labels', and check 'Category Name'. To do it programmatically, use VBA: `ActiveChart.FullSeriesCollection(1).DataLabels.ShowCategoryName = True`.

Submit a Feature Request to Microsoft
Because there is no built-in method to manipulate Modern Chart data labels programmatically, notifying the product team is the official avenue for a future fix.
Try WPS Office for Seamless Charting and Data Visualization
If you are frustrated by the programmatic limitations of modern charts in other software, consider switching to WPS Office. WPS Spreadsheet provides highly compatible standard charting tools, a familiar interface, and excellent VBA macro support, entirely for free. Visualize your data effectively without the high subscription costs.
- 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install WPS Office: Run the downloaded installer and follow the on-screen prompts to complete the installation in minutes.
- 3. Open your spreadsheets: Launch WPS Spreadsheet and easily open your existing .xlsx files to continue working seamlessly.

Frequently Asked Questions
What are considered 'Modern Charts' in spreadsheets?
Modern Charts refer to the specific visualization types introduced in Office 2016, which include Treemap, Sunburst, Histogram, Box & Whisker, Waterfall, and Funnel charts. These rely on a newer rendering engine that has limited VBA object model support.
Can I manually show category names in Modern Chart labels?
No native toggle exists for Category Names in most Modern Chart data labels. You can manually double-click an individual data label and type the category name, but this text remains static and will not update if your source data changes.
Is it possible to trigger a chart reload event using VBA for modern charts?
VBA event handling for modern charts is highly restricted. Standard chart events like 'Calculate' or standard object model refresh methods often do not apply cleanly to Modern Charts. It is generally recommended to stick with standard charts if event-driven automation is required.




