M ChartM Chart
Users
Highcharts
Developers
Download
GitHub
Users
Highcharts
Developers
Download
GitHub
  • User Guide

    • User Guide
    • Libraries
    • Types of Charts
    • Creating a Chart
    • Multiple Sheets
    • Scatter & Bubble Charts
    • Radar & Radar Area Charts
    • Treemap Charts
    • Boxplots & Violin Charts
    • Chart Shortcode
    • Block Editor
    • CSV Import & Export
    • Settings
    • Chart Units
    • Themes
    • Duplicating Charts
    • Example Charts

Chart Units

Chart Units let you label a chart's axes with consistent unit names — USD, Tonnes, Visitors, Percent, and so on. The unit you pick appears alongside (or as) the axis title on the rendered chart, so readers immediately know what the numbers mean.

Units are stored as a standard WordPress taxonomy named Chart Units, attached to the Charts post type. The taxonomy is hierarchical: parent terms are groups (Money, Time, Length, …) and child terms are the units the user can actually pick (USD, Seconds, Meter, …). The plugin ships with a set of common groups and units out of the box, and you can add your own at any time.

Default groups

M Chart pre-populates these groups the first time the plugin runs:

GroupUnits
TimeSeconds, Minutes, Hours, Days, Weeks, Months, Quarter, Years, Decades, Centuries
MoneyUSD, EUR, GBP, JPY, CNY
LengthInch, Foot, Yard, Mile, Millimeter, Centimeter, Meter, Kilometer
WeightTonnes, Tons, Kilograms, Grams, Milligrams, Pounds, Ounces
OtherPercent
Website/TrafficVisitors, Unique Visitors, Clicks, Referrers, Active Users, Pages
SalesUnits, CPM

You don't have to use any of these — they're just starting points. They can be renamed or deleted from the admin like any other WordPress term.

Adding new units

  1. In the WordPress admin, open Charts → Chart Units.
  2. To add a unit: fill in the Name field, pick the parent group from the Parent Chart Unit dropdown, and click Add New Chart Unit. The slug can be left blank — WordPress derives it from the name.
  3. To add a new group: fill in the Name field, leave Parent Chart Unit set to None, and click Add New Chart Unit. A top-level term with no parent becomes a new group that other units can be nested under.

Group order

Groups appear in the chart Units dropdown alphabetically. Name them with that in mind if ordering matters.

Applying units to a chart

The unit pickers live in the Chart meta box on the chart edit screen, in the same row as each axis title field:

  1. Open a chart for editing.
  2. Find the Vertical axis title and Horizontal axis title rows in the chart settings panel.
  3. Each row has a Units dropdown next to the title field. Pick the unit that matches the axis's values.

The dropdown lists every group as a disabled header (visual separator) followed by its child units. Pick a child unit — the parent groups themselves aren't selectable. Choose N/A to clear the unit.

When the chart renders:

  • If you also filled in the axis title, the unit appears in parentheses after it: a chart with Vertical axis title = Yield and Units = Tonnes/hectare renders the y-axis label as Yield (Tonnes/hectare).
  • If the axis title is blank, the unit name is the axis label.

Filtering and querying by unit

Because Chart Units is a standard WordPress taxonomy (slug m-chart-units), it works with WordPress's usual filtering and querying mechanisms — useful for surfacing "every chart on the site using X" without writing custom storage:

  • Term archive URLs — each unit has a public archive at /m-chart-units/<slug>/ listing every published chart tagged with that unit. Link readers to e.g. https://example.com/m-chart-units/usd/ to show all charts measured in US dollars.
  • Custom queries — pass a tax_query against the m-chart-units taxonomy to WP_Query (or get_posts) to fetch charts by unit from theme templates, custom blocks, or admin reports.
  • REST API — the /wp/v2/m-chart endpoint accepts ?m-chart-units=<term_id> to filter the returned charts by unit. Useful for headless setups and external consumers.

Limits and gotchas

  • Units only apply to chart types that have axes — bar, column, line, area, scatter, bubble, treemap (no axes; dropdown hidden), boxplot, violin, etc. On pie, doughnut, radar, radar area, and polar charts there are no x/y axes, so the Units row doesn't appear in the chart settings.
  • Custom units survive plugin updates — they're standard WordPress terms stored in your site's database.
  • The unit name shown on the chart is whatever you type into the term's Name. If you need different display text for one chart, the cleanest workaround is to leave Units set to N/A and put the unit text directly into the axis title field.
  • Treemap renders the rectangles' value prefix/suffix from each row's data cell (e.g., $4500, 2200kg), not from this taxonomy. The Units dropdown isn't shown for treemap charts.
Last Updated: 5/15/26, 4:54 PM
Contributors: Jamie Poitra
Prev
Settings
Next
Themes