Skip to Content

Metrics

Let viewers switch the chart axis

Give viewers a list of fields they can put on the X axis or the Y axis of a chart.

Before you start

  • Your role can edit Switch Axis. Admins, Editors and Developers can by default.
  • The metric uses one of these charts: Line, Bar, Area, Combo, Scatter, Bubble, Stack, Waterfall, Stacked Area, Pie, Doughnut, Row or Horizontal Stack. Switch Y Axis also works on Time Series and does not work on Combo.
  • The comparison filter is off.

Steps

  1. Open the metric in the metric builder.

  2. Select Appearance in the chart toolbar.

    Metric builder chart toolbar with Bar, Drill-down and the Appearance icon highlighted
    Appearance is the sliders icon at the right of the chart toolbar.
  3. Select the Actions tab.

    Chart settings dialog with the Actions tab highlighted
    Chart settings has two tabs: Appearance and Actions.
  4. Open Add Actions On Current Card.

    Chart settings Actions tab with the Add Actions On Current Card section highlighted
    Add Actions On Current Card holds the switch axis settings.
  5. Turn on Switch X Axis. Each switch has the line Switch Axis under its name.

    Add Actions On Current Card with the Switch X Axis switch on and highlighted
    Turn on Switch X Axis.
  6. In Horizontal Axis options, select the dimensions viewers can pick from.

    Horizontal Axis options set to sales channel and product category, highlighted
    Horizontal Axis options lists the dimensions viewers can switch to.
  7. Optional: select Enable Custom Fields to add the table’s custom fields to the list.

  8. Turn on Switch Y Axis.

  9. In Vertical Axis options, select the measures viewers can pick from.

    Vertical Axis options set to sum of quantity sold, highlighted, with Enable Multi Select under it
    Vertical Axis options lists the measures viewers can switch to.
  10. Optional: select Enable Multi Select so viewers can show more than one measure at a time.

  11. Wait for Saved in the header. The builder saves chart settings on its own.

The chart now shows the axis lists. The first field you selected is the default.

A faster way: select Add filter above the chart, then Switch X Axis or Switch Y Axis. This turns the switch on with every field in the list. Change the list in the Actions tab.

On horizontal charts, such as a horizontal bar, Row and Horizontal Stack, the labels swap. Switch Y Axis changes the dimension, with Vertical Axis options. Switch X Axis changes the measure, with Horizontal Axis options.

If something goes wrong

  • Switch X Axis is greyed out in the Add filter menu. It is already on. Change it in the Actions tab.
  • Enable Custom Fields is not shown. The metric’s main table has no custom fields.
  • The Actions tab is greyed out. The chart is Gauge V2, Linear Gauge V2, Progress Bar V2 or Gantt, or the metric is a dynamic table from SQL.