ComposedChart

ComposedChart is a component for drawing composed charts to compare multiple sets of data.

Usage

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

Composition

Change Size

Change Color Scheme

Change Color

Add Y Axis

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

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

Add Legend

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

Change Name

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

Change Grid

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

Change Line Type

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

Add Line Dot

To add a dot to the line, set dot in series or lineProps.dot or areaProps.dot to true. The default is false.

Range Bar

To add a range bar, set the value to an [min, max] array in the data item.

Stacked Bar

To stack the bars, set stackId in series or barProps.stackId to a string.

Change Bar Size

To change the bar size, set barSize in series or barProps.barSize to a number. The default is 40.

Change Bar Radius

To change the bar radius, set radius in series or barProps.radius to a number or an array.

Change Bar Gap

To change the bar gap, set barGap in chartProps and barSize in barProps to a number or string.

Show Label

To show the label, set label in series or lineProps.label or areaProps.label or barProps.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 charts, 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 to the axis, set tickLine in xAxisProps or yAxisProps to true. The default is false.

Add Axis Label

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

Set Domain

To set the range, set domain to an array in yAxisProps. To set the interval, 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 in series or lineProps.activeDot or areaProps.activeDot to false. The default is true.

Hide Tooltip

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

Props