Nuxt Dashboard — dashboard components and a full starter app for Nuxt UI
DocumentationNuxt Charts v3

Dual Y-Axis

Plot series with different units on independent left and right y-axes in LineChart, AreaChart, and BarChart.

Use a secondary y-axis when series have different units or scales, such as revenue in euros and conversion in percent. It works on LineChart, AreaChart, and vertical BarChart.

Basic Usage

  1. Leave series on the left axis as they are. They use the primary axis, which has id 0.
  2. Give each series on the right axis a yAxis id.
  3. Describe that axis in the yAxes prop, under the same id.

Series that share an id share a scale.

Keep at least one series on the primary axis. It always renders, so if every series uses a named id you get an empty axis on the left, with no grid lines or reference lines.

Bars with a Line

In a BarChart, set type: 'line' on a category to draw it as a line over the bars. Use this instead of the v2 DualChart component, which isn't available in v3.

type: 'line' is a preview API and may change in a minor release. It requires nuxt-charts 3.2.0 or later.
  • List line series in the yAxis prop too. That prop picks the data keys; the category's yAxis field picks the axis.
  • Lines are unstacked, with monotone curves and no dots.
  • Bar options such as variant, stacked, valueLabel, and radius don't apply to lines.
  • On a horizontal BarChart, the category stays a bar.

Axis Options

Each yAxes entry is a YAxisConfig. It accepts these options, plus the AxisConfig tick options:

OptionTypeDefaultDescription
orientation'left' | 'right''left'Side of the plot area. Set 'right' for a secondary axis.
labelstringundefinedAxis label.
domain[number | undefined, number | undefined]InheritedFixed [min, max] for this axis.
numTicksnumberInheritedDesired number of ticks.
formatteraxisFormatterInheritedFormats ticks and the tooltip values of this axis' series.
hidebooleanfalseHides the axis but keeps its scale and series.

Inherited Values

Options marked Inherited fall back to the top-level yDomain, yNumTicks, and yFormatter props. A right axis without its own values picks up the left axis' domain and formatter, so:

  • Configure both axes inside yAxes, and use the 0 key for the primary axis.
  • Don't combine top-level yDomain or yFormatter with a secondary axis, unless that axis sets its own domain and formatter.

Tooltips only use formatter from yAxes. A top-level yFormatter formats ticks, not tooltip values.

Axis Config

tickValues, tickLine, minMaxTicksOnly, tickTextColor, tickTextFontSize, and tickTextAlign work per axis, as they do in yAxisConfig.

Grid Lines and Reference Lines

Grid lines and referenceLines follow the primary axis, so a reference line's y is a value on the left scale.

To line up right-axis ticks with the grid, give both axes a fixed domain and the same numTicks, as in the examples above.

Stacking

stacked is applied per axis on BarChart and AreaChart. Series on different axes are never summed together.

Limitations

  • Horizontal bars: there is a single value axis, so yAxes is ignored.
  • hideYAxis: hides every axis. Series keep their independent scales. To hide one axis, use hide on its yAxes entry.
  • Missing orientation: a yAxis id without an orientation: 'right' entry in yAxes gets a second axis on the left.