AreaChart

AreaChart is a component for drawing area charts to compare multiple sets of data.

Usage

import { AreaChart } from "@yamada-ui/react"
<AreaChart.Root>
  <AreaChart.Area>
    <AreaChart.LabelList />
  </AreaChart.Area>
  <AreaChart.Label />
  <AreaChart.ReferenceLine />
  <AreaChart.Grid />
  <AreaChart.XAxis />
  <AreaChart.YAxis />
  <AreaChart.Tooltip />
  <AreaChart.Legend />
</AreaChart.Root>

Composition

Change Size

Change Color Scheme

Change Color

Add Gradient

To add a gradient, set withGradient or areaProps.withGradient to true. The default is false.

Change Type

To change the type, set type in series or areaProps.type to "monotone", "linear", etc. The default is "monotone".

Stacked

To stack the series, set stackId or areaProps.stackId to a string.

Percent

To make the series a percentage, set stackId or areaProps.stackId to a string and set chartProps.stackOffset to "expand".

Add Y Axis

To add the Y axis, set withYAxis to true. The default is false.

To change the orientation of the Y axis, set yAxisProps.orientation to "start" or "end". The default is "start".

Add Legend

To add the legend, set withLegend to true. The default is false. To change the placement of the legend, set legendProps.placement to "start-start", "end-end", etc. The default is "start-end".

Change Name

To change the name of the tooltip or legend, set name to a string in series.

Change Grid

To change the grid, set horizontal and vertical to a boolean in gridProps.

Add Dot

To add a dot, set dot of series or areaProps.dot to true. The default is false.

Add Label

To add a label, set label of series or areaProps.label to true. The default is false.

Add Unit

To add a unit, use formatter or tickFormatter or set unit to a string.

Sync

To sync the chart, set syncId to a string.

Format

To format the chart, use formatter or tickFormatter etc.

Add Reference Line

Add Tick Line

To add a tick line, set tickLine to true in xAxisProps or yAxisProps. The default is false.

Add Axis Label

To add an axis label, set label to a string in xAxisProps or yAxisProps. The default is false.

Set Domain

To set the domain, set domain to an array in yAxisProps. To set the ticks, set ticks to an array in yAxisProps.

Add Tooltip Cursor

To add a tooltip cursor, set cursor to true in tooltipProps. The default is false.

Hide X Axis

To hide the X axis, set withXAxis to false. The default is true.

Hide Active Dot

To hide the active dot, set activeDot or areaProps.activeDot to false. The default is true.

Hide Tooltip

To hide the tooltip, set withTooltip to false. The default is true.

Customize Axis

Customize Dot

Customize Active Dot

Customize Label

Customize Grid

Customize Tooltip Cursor

Props