# PercentageBarChart

**📖 Live documentation:** https://cds.coinbase.com/components/charts/PercentageBarChart/?platform=mobile

A bar chart component for comparing share or mix across categories as percentages. Supports horizontal and vertical orientations, 100% stacked bars, and a fixed 0–100% value axis.

## Import

```tsx
import { PercentageBarChart } from '@coinbase/cds-mobile/visualizations/chart'
```

## Examples

PercentageBarChart is a wrapper for [BarChart](/components/charts/BarChart) that simplifies the creation of segmented, part-to-whole horizontal visualizations. Charts are built using `@shopify/react-native-skia`.

### Basics

The only prop required is `series`, which takes an array of series objects. Each series object needs an `id` and a value for `data`.

```jsx
<PercentageBarChart
  height={16}
  series={[
    { id: 'a', data: 70, label: 'Segment A', color: theme.color.fgPositive },
    { id: 'b', data: 45, label: 'Segment B', color: theme.color.fgNegative },
  ]}
/>
```

### Stack Gap

Use `stackGap` to add space between segments while keeping the full bar length.

```jsx
<PercentageBarChart
  height={20}
  series={[
    { id: 'a', data: 40, label: 'A', color: theme.color.fgPositive },
    { id: 'b', data: 35, label: 'B', color: theme.color.fgWarning },
    { id: 'c', data: 20, label: 'C', color: theme.color.accentBoldPurple },
  ]}
  stackGap={6}
/>
```

### Border Radius

Bars use `borderRadius` like in [BarChart](/components/charts/BarChart/#border-radius).

```jsx
<PercentageBarChart
  borderRadius={1000}
  height={28}
  series={[
    { id: 'a', data: 45, color: `rgb(${theme.spectrum.purple30})`, label: 'A' },
    { id: 'b', data: 30, color: `rgb(${theme.spectrum.blue30})`, label: 'B' },
    { id: 'c', data: 20, color: `rgb(${theme.spectrum.teal30})`, label: 'C' },
  ]}
  stackGap={2}
/>
```

### Data

**Negative** values, **`null`**, and **missing indices** from a shorter `data` array are treated as **zero** for that segment at that category. A **single-number** `data` value applies to the **first** category only—later categories count as zero for that series.

```jsx
<PercentageBarChart
  height={100}
  showXAxis
  showYAxis
  barMinSize={12}
  borderRadius={8}
  series={[
    { id: 'a', data: [40, null, 20], label: 'A', color: theme.color.fgPositive },
    { id: 'b', data: [-10, 60, 30], label: 'B', color: theme.color.fgWarning },
    { id: 'c', data: [null, 50], label: 'C', color: theme.color.fgMuted },
    { id: 'd', data: 45, label: 'D', color: theme.color.fgNegative },
  ]}
  stackGap={2}
  xAxis={{ showTickMarks: true }}
  yAxis={{
    data: ['Q1', 'Q2', 'Q3'],
    position: 'left',
    categoryPadding: 0.45,
  }}
/>
```

If **every** group sums to zero after clamping, nothing is drawn—handle that in surrounding UI.

### Customization

#### Bar Stack Spacing

Use `categoryPadding` on the band axis to adjust spacing between stacks.

```jsx
<PercentageBarChart
  legend
  showXAxis
  showYAxis
  barMinSize={18}
  borderRadius={24}
  height={240}
  series={[
    { id: 'a', data: [55, 40, 35], label: 'A', color: theme.color.fgWarning },
    { id: 'b', data: [30, 45, 25], label: 'B', color: theme.color.accentBoldPurple },
    { id: 'c', data: [15, 15, 40], label: 'C', color: theme.color.fgMuted },
  ]}
  stackGap={4}
  xAxis={{ showTickMarks: true }}
  yAxis={{
    data: ['Q1', 'Q2', 'Q3'],
    position: 'left',
    categoryPadding: 0.7,
  }}
/>
```

#### Minimum Bar Size

`barMinSize` keeps a thin share wide enough to see or tap when one segment dominates:

```jsx
<PercentageBarChart
  barMinSize={16}
  height={16}
  series={[
    { id: 'a', data: 99, label: 'Segment A', color: theme.color.fgPositive },
    { id: 'b', data: 0.001, label: 'Segment B', color: theme.color.fgNegative },
  ]}
  stackGap={2}
/>
```

#### Custom Components

##### Slanted Stack Gap

A custom `BarComponent` that replaces the default rectangular inner edges with **slanted cuts**, creating a parallelogram-shaped gap purely from the path geometry—no `stackGap` needed. Outer ends stay pill-shaped.

```jsx
function SlantedStackExample() {
  function getSlantedHorizontalBarPath(
    x,
    y,
    width,
    height,
    borderRadius,
    pillLeft,
    pillRight,
    slantDx,
  ) {
    if (width <= 0 || height <= 0 || pillLeft === pillRight) return undefined;

    const r = Math.min(borderRadius, height / 2, width / 2);
    const s = Math.min(Math.max(0, slantDx), width - r * 2);
    const x0 = x,
      x1 = x + width,
      y0 = y,
      y1 = y + height;

    if (pillLeft && !pillRight) {
      return [
        `M ${x0 + r} ${y0}`,
        `L ${x1} ${y0}`,
        `L ${x1 - s} ${y1}`,
        `L ${x0 + r} ${y1}`,
        `A ${r} ${r} 0 0 1 ${x0} ${y1 - r}`,
        `L ${x0} ${y0 + r}`,
        `A ${r} ${r} 0 0 1 ${x0 + r} ${y0}`,
        'Z',
      ].join(' ');
    }

    return [
      `M ${x0 + s} ${y0}`,
      `L ${x1 - r} ${y0}`,
      `A ${r} ${r} 0 0 1 ${x1} ${y0 + r}`,
      `L ${x1} ${y1 - r}`,
      `A ${r} ${r} 0 0 1 ${x1 - r} ${y1}`,
      `L ${x0} ${y1}`,
      'Z',
    ].join(' ');
  }

  const SLANT_DX = 8;

  const SlantedStackBar = memo(function SlantedStackBar(props) {
    const { layout } = useCartesianChartContext();
    const {
      x,
      y,
      width,
      height,
      borderRadius = 4,
      roundTop,
      roundBottom,
      dataX,
      d: defaultD,
      fill,
      fillOpacity,
      origin: _origin,
      dataY: _dataY,
      seriesId: _seriesId,
      minSize: _minSize,
      ...rest
    } = props;

    const d = useMemo(() => {
      if (layout !== 'horizontal') {
        return (
          defaultD ??
          getBarPath(x, y, width, height, borderRadius, !!roundTop, !!roundBottom, layout)
        );
      }
      const isLeftmost = Array.isArray(dataX) && Math.abs(dataX[0]) < 1;
      return (
        getSlantedHorizontalBarPath(
          x,
          y,
          width,
          height,
          borderRadius,
          isLeftmost,
          !isLeftmost,
          SLANT_DX,
        ) ??
        defaultD ??
        getBarPath(x, y, width, height, borderRadius, !!roundTop, !!roundBottom, layout)
      );
    }, [layout, defaultD, dataX, x, y, width, height, borderRadius, roundTop, roundBottom]);

    if (!d) return null;

    return (
      <Path
        {...rest}
        animate
        clipPath={null}
        d={d}
        fill={fill}
        fillOpacity={fillOpacity}
        transitions={props.transitions}
      />
    );
  });

  return (
    <PercentageBarChart
      animate={false}
      BarComponent={SlantedStackBar}
      barMinSize={12}
      borderRadius={24}
      height={12}
      series={[
        { id: 'team-a', data: 40, color: `rgb(${theme.spectrum.teal60})` },
        { id: 'team-b', data: 61, color: theme.color.accentBoldBlue },
      ]}
    />
  );
}
```

##### Dotted bar

A custom `BarComponent` can render a **dotted fill** (Skia path from `getDottedAreaPath` plus an outlined `DefaultBar`). Set `BarComponent` on **one series** to emphasize a single segment, or on the **chart** to apply the same look to every segment.

```jsx
function DottedBarExamples() {
  const DOTTED_BAR_PATTERN_SIZE = 4;
  const DOTTED_BAR_DOT_SIZE = 1;
  const DOTTED_BAR_OUTLINE_STROKE_WIDTH = 2;

  const DottedBarComponent = memo(function DottedBarComponent(props) {
    const { x, y, width, height, fill, d } = props;

    const dottedPath = useMemo(
      () =>
        getDottedAreaPath({ x, y, width, height }, DOTTED_BAR_PATTERN_SIZE, DOTTED_BAR_DOT_SIZE),
      [x, y, width, height],
    );

    const barClipPath = useMemo(
      () => (d ? (Skia.Path.MakeFromSVGString(d) ?? undefined) : undefined),
      [d],
    );

    const dotsSkiaPath = useMemo(
      () => (dottedPath ? (Skia.Path.MakeFromSVGString(dottedPath) ?? undefined) : undefined),
      [dottedPath],
    );

    return (
      <>
        <Group clip={barClipPath}>
          {dotsSkiaPath && fill ? <SkiaPath color={fill} path={dotsSkiaPath} style="fill" /> : null}
        </Group>
        <DefaultBar
          {...props}
          fill={undefined}
          stroke={fill}
          strokeWidth={DOTTED_BAR_OUTLINE_STROKE_WIDTH}
        />
      </>
    );
  });

  const dottedBarSeries = [
    {
      id: 'segment-a',
      data: 60,
      label: 'Segment A',
      color: `rgb(${theme.spectrum.teal60})`,
      BarComponent: DottedBarComponent,
    },
    { id: 'segment-b', data: 30, label: 'Segment B', color: `rgb(${theme.spectrum.chartreuse50})` },
    { id: 'segment-c', data: 10, label: 'Segment C', color: `rgb(${theme.spectrum.indigo40})` },
  ];

  const dottedBarSeriesPlain = [
    { id: 'segment-a', data: 60, label: 'Segment A', color: `rgb(${theme.spectrum.teal60})` },
    { id: 'segment-b', data: 30, label: 'Segment B', color: `rgb(${theme.spectrum.chartreuse50})` },
    { id: 'segment-c', data: 10, label: 'Segment C', color: `rgb(${theme.spectrum.indigo40})` },
  ];

  return (
    <VStack gap={3}>
      <VStack gap={1}>
        <Text color="fgMuted" font="label2">
          First series only
        </Text>
        <PercentageBarChart height={24} series={dottedBarSeries} stackGap={4} />
      </VStack>
      <VStack gap={1}>
        <Text color="fgMuted" font="label2">
          Chart-level BarComponent
        </Text>
        <PercentageBarChart
          BarComponent={DottedBarComponent}
          height={24}
          series={dottedBarSeriesPlain}
          stackGap={4}
        />
      </VStack>
    </VStack>
  );
}
```

### Animations

Configure motion with the `transitions` prop. Toggle motion with `animate`.

```jsx
function AnimationsExample() {
  const [animate, setAnimate] = useState(true);

  function randomShares() {
    const raw = [Math.random() + 0.1, Math.random() + 0.1, Math.random() + 0.1];
    const sum = raw[0] + raw[1] + raw[2];
    return raw.map((v) => Math.max(1, Math.round((v / sum) * 100)));
  }

  function generateData() {
    return [randomShares(), randomShares(), randomShares()];
  }

  const [data, setData] = useState(generateData);

  useEffect(() => {
    const id = setInterval(() => setData(generateData()), 800);
    return () => clearInterval(id);
  }, []);

  const series = [
    { id: 'btc', data: data.map((q) => q[0]), label: 'BTC', color: assets.btc.color },
    {
      id: 'eth',
      data: data.map((q) => q[1]),
      label: 'ETH',
      color: assets.eth.color,
    },
    {
      id: 'other',
      data: data.map((q) => q[2]),
      label: 'Other',
      color: theme.color.fgMuted,
    },
  ];

  return (
    <VStack gap={2}>
      <HStack justifyContent="flex-end" alignItems="center" gap={1}>
        <Switch checked={animate} onChange={() => setAnimate((v) => !v)}>
          Animate
        </Switch>
      </HStack>
      <PercentageBarChart
        animate={animate}
        legend
        showXAxis
        showYAxis
        barMinSize={14}
        borderRadius={48}
        height={220}
        inset={{ left: 24, right: 0, top: 0, bottom: 0 }}
        legendPosition="top"
        transitions={{
          enter: { type: 'timing', duration: 400, staggerDelay: 0.2 },
          update: { type: 'timing', duration: 300 },
        }}
        series={series}
        stackGap={2}
        xAxis={{
          showTickMarks: true,
          tickLabelFormatter: (value) => `${value}%`,
        }}
        yAxis={{
          categoryPadding: 0.75,
          data: ['Q1 2025', 'Q2 2025', 'Q3 2025'],
          position: 'left',
          requestedTickCount: 5,
          showTickMarks: true,
        }}
      />
    </VStack>
  );
}
```

#### Stagger Delay

```jsx
<PercentageBarChart
  transitions={{
    enter: { type: 'spring', stiffness: 700, damping: 80, staggerDelay: 250 },
  }}
  height={120}
  showYAxis
  series={[
    { id: 'a', data: [20, 35, 50, 40], color: theme.color.fgPositive },
    { id: 'b', data: [30, 25, 20, 30], color: theme.color.fgWarning },
    { id: 'c', data: [50, 40, 30, 30], color: theme.color.accentBoldPurple },
  ]}
  stackGap={2}
  yAxis={{ data: ['A', 'B', 'C', 'D'], position: 'left', categoryPadding: 0.4 }}
/>
```

#### Delay

```jsx
<PercentageBarChart
  transitions={{
    enter: { type: 'spring', stiffness: 700, damping: 80, delay: 250 },
  }}
  height={120}
  series={[
    { id: 'a', data: 60, color: theme.color.fgPositive },
    { id: 'b', data: 40, color: theme.color.fgMuted },
  ]}
  stackGap={2}
/>
```

### Accessibility

Unlike [BarChart](/components/charts/BarChart/), `PercentageBarChart` does **not** expose scrubbing props. Provide an `accessibilityLabel` on the chart so assistive technologies can describe the visualization. Optionally set `legendAccessibilityLabel` when using the built-in legend.

```jsx
<PercentageBarChart
  accessibilityLabel="Stacked percentage chart: roughly half confirmed and half needs review."
  height={24}
  legend
  legendAccessibilityLabel="Allocation legend"
  series={[
    { id: 'yes', data: 52, label: 'Confirmed', color: theme.color.fgPositive },
    { id: 'no', data: 48, label: 'Needs review', color: theme.color.fgWarning },
  ]}
  stackGap={2}
/>
```

### Composed Examples

#### Live-updating Data

Using a custom legend, you can create a prediction markets-style chart that stays in sync when data changes.

```jsx
function LiveFeedExample() {
  const liveFeedSubtitleBase = 100;
  const liveFeedYesDollarsPerPercentPoint = (182 - liveFeedSubtitleBase) / 50;
  const liveFeedNoDollarsPerPercentPoint = (222 - liveFeedSubtitleBase) / 50;

  function getLiveFeedProjectedValue(seriesId, percentage) {
    const inverseShare = 100 - percentage;
    if (seriesId === 'yes') {
      return Math.round(liveFeedSubtitleBase + inverseShare * liveFeedYesDollarsPerPercentPoint);
    }
    if (seriesId === 'no') {
      return Math.round(liveFeedSubtitleBase + inverseShare * liveFeedNoDollarsPerPercentPoint);
    }
    return undefined;
  }

  const liveFeedCurrencyFormat = {
    style: 'currency',
    currency: 'USD',
    maximumFractionDigits: 0,
  };

  const LiveFeedCTALegendEntry = memo(function LiveFeedCTALegendEntry({ seriesId, label, color }) {
    const { series } = useCartesianChartContext();
    const seriesData = series.find((s) => s.id === seriesId);
    const percentage = seriesData?.data?.[0] ?? 0;
    const projectedValue = getLiveFeedProjectedValue(seriesId, percentage);

    return (
      <Button
        compact
        borderRadius={200}
        onPress={() => {}}
        style={{ backgroundColor: color, borderColor: color }}
        width="25%"
      >
        <VStack alignItems="center" gap={0.25}>
          <HStack alignItems="center" gap={0.5}>
            <Text color="fgInverse" font="label1">
              {label} {'· '}
            </Text>
            <RollingNumber
              color="fgInverse"
              font="label1"
              format={{ style: 'percent', maximumFractionDigits: 0 }}
              value={percentage / 100}
            />
          </HStack>
          {projectedValue != null && (
            <HStack alignItems="center" gap={0.5}>
              <Text color="fgInverse" font="legal">
                ${liveFeedSubtitleBase} →
              </Text>
              <RollingNumber
                color="fgInverse"
                font="legal"
                format={liveFeedCurrencyFormat}
                value={projectedValue}
              />
            </HStack>
          )}
        </VStack>
      </Button>
    );
  });

  function LiveFeedChart() {
    const [tick, setTick] = useState(0);

    const yesValue = 50 + Math.sin(tick * 0.05) * 49;
    const noValue = 50 - Math.sin(tick * 0.05) * 49;

    const series = [
      { id: 'yes', data: yesValue, label: 'Yes', color: theme.color.fgPositive },
      { id: 'no', data: noValue, label: 'No', color: theme.color.fgNegative },
    ];

    useEffect(() => {
      const id = setInterval(() => setTick((t) => t + 4), 1000);
      return () => clearInterval(id);
    }, []);

    return (
      <PercentageBarChart
        barMinSize={16}
        borderRadius={1000}
        height={78}
        legend={
          <Legend
            EntryComponent={LiveFeedCTALegendEntry}
            justifyContent="space-evenly"
            paddingTop={1}
          />
        }
        legendPosition="bottom"
        series={series}
        stackGap={2}
      />
    );
  }

  return <LiveFeedChart />;
}
```

#### Vertical Mix

Monthly **BTC / ETH / Other** portfolio allocation across a full year, with `layout="vertical"` and the legend on the right.

```jsx
<PercentageBarChart
  legend
  showXAxis
  showYAxis
  barMinSize={28}
  borderRadius={48}
  height={240}
  layout="vertical"
  legendPosition="top"
  series={[
    {
      id: 'btc',
      data: [55, 52, 48, 45, 50, 58, 62, 57, 53, 49, 44, 46],
      label: 'BTC',
      color: assets.btc.color,
    },
    {
      id: 'eth',
      data: [30, 33, 35, 38, 32, 27, 25, 29, 34, 37, 40, 38],
      label: 'ETH',
      color: assets.eth.color,
    },
    {
      id: 'other',
      data: [15, 15, 17, 17, 18, 15, 13, 14, 13, 14, 16, 16],
      label: 'Other',
      color: theme.color.fgMuted,
    },
  ]}
  stackGap={1}
  xAxis={{
    categoryPadding: 0.5,
    data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
    position: 'bottom',
    showTickMarks: true,
  }}
/>
```

#### Buy vs Sell

You can combine a PercentageBarChart with a custom legend to create a buy vs sell chart.

```jsx
function BuyVsSellExample() {
  const series = [
    { id: 'buy', data: 76, color: theme.color.fgPositive, legendShape: 'circle' },
    { id: 'sell', data: 24, color: theme.color.fgNegative, legendShape: 'square' },
  ];

  function BuyVsSellLegend() {
    const [buy, sell] = series;
    return (
      <HStack gap={1} justifyContent="space-between">
        <DefaultLegendEntry
          color={buy.color}
          label={
            <Text color="fgMuted" font="legal">
              {`${buy.data}% bought`}
            </Text>
          }
          seriesId={buy.id}
          shape={buy.legendShape}
        />
        <DefaultLegendEntry
          color={sell.color}
          label={
            <Text color="fgMuted" font="legal">
              {`${sell.data}% sold`}
            </Text>
          }
          seriesId={sell.id}
          shape={sell.legendShape}
        />
      </HStack>
    );
  }

  return (
    <VStack gap={1.5}>
      <PercentageBarChart
        barMinSize={8}
        borderRadius={24}
        height={8}
        series={series}
        stackGap={4}
      />
      <BuyVsSellLegend />
    </VStack>
  );
}
```

## Props

| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `BarComponent` | `BarComponent` | No | `-` | Component to render the bar. |
| `BarStackComponent` | `BarStackComponent` | No | `DefaultBarStack` | Custom component to render the stack container. Can be used to add clip paths, outlines, or other custom styling. |
| `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
| `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
| `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
| `allowOverflowGestures` | `boolean` | No | `-` | Allows continuous gestures on the chart to continue outside the bounds of the chart element. |
| `animate` | `boolean` | No | `true` | Whether to animate the chart. |
| `animated` | `boolean` | No | `-` | - |
| `aspectRatio` | `string \| number` | No | `-` | - |
| `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
| `barMinSize` | `number` | No | `-` | Minimum size for individual bars in the stack. |
| `barPadding` | `number` | No | `0.1` | Padding between bar groups (0-1). |
| `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
| `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderRadius` | `number` | No | `4` | Border radius for the bar. |
| `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
| `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
| `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
| `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
| `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
| `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
| `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
| `bottom` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
| `columnGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `dangerouslySetBackground` | `string` | No | `-` | - |
| `display` | `flex \| none \| contents` | No | `-` | - |
| `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
| `fillOpacity` | `number` | No | `-` | Fill opacity for the bar. |
| `flexBasis` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
| `flexGrow` | `number` | No | `-` | - |
| `flexShrink` | `number` | No | `-` | - |
| `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
| `font` | `inherit \| FontFamily` | No | `-` | - |
| `fontFamilies` | `string[]` | No | `-` | Default font families to use within ChartText. If not provided, will be the default for the system. |
| `fontProvider` | `SkTypefaceFontProvider` | No | `-` | Skia font provider to allow for custom fonts. If not provided, the only available fonts will be those defined by the system. |
| `fontSize` | `inherit \| FontSize` | No | `-` | - |
| `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
| `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `getScrubberAccessibilityLabel` | `((dataIndex: number) => string)` | No | `-` | Function that returns the accessibility label for each scrubber point. Receives dataIndex for each scrubber point label. |
| `height` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `inset` | `number \| Partial<ChartInset>` | No | `0` | Inset around the entire chart (outside the axes). |
| `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
| `key` | `Key \| null` | No | `-` | - |
| `layout` | `horizontal \| vertical` | No | `'horizontal'` | Chart layout - describes the direction bars/areas grow. - vertical: Bars grow vertically. X is category axis, Y is value axis. - horizontal (default): Bars grow horizontally. Y is category axis, X is value axis. |
| `left` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `legend` | `null \| string \| number \| bigint \| false \| true \| ReactElement<unknown, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| Promise<AwaitedReactNode>` | No | `-` | Whether to show the legend or a custom legend element. - true renders the default Legend component - A React element renders that element as the legend - false or omitted hides the legend |
| `legendAccessibilityLabel` | `string` | No | `'Legend'` | Accessibility label for the legend group. |
| `legendPosition` | `top \| bottom \| left \| right` | No | `'bottom'` | Position of the legend relative to the chart. |
| `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
| `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
| `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
| `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
| `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
| `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
| `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
| `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
| `maxHeight` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `maxWidth` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `minHeight` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `minWidth` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
| `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
| `opacity` | `number \| AnimatedNode` | No | `-` | - |
| `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
| `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
| `position` | `absolute \| relative \| static` | No | `-` | - |
| `ref` | `null \| RefObject<View \| null> \| (instance: View \| null) => void \| (() => VoidOrUndefinedOnly)` | No | `-` | Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref). |
| `right` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `roundBaseline` | `boolean` | No | `true` | Whether to round the baseline of a bar (where the value is 0). |
| `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
| `scrubberAccessibilityLabelStep` | `number` | No | `-` | Number of data points to move between screen-reader samples. |
| `series` | `PercentageBarSeries[]` | No | `-` | Configuration objects that define how to visualize the data. Each series contains its own data. |
| `showXAxis` | `boolean` | No | `-` | Whether to show the X axis. |
| `showYAxis` | `boolean` | No | `-` | Whether to show the Y axis. |
| `stackGap` | `number` | No | `-` | Gap between bars in the stack. |
| `stackMinSize` | `number` | No | `-` | Minimum size for the entire stack. |
| `stroke` | `string` | No | `-` | Stroke color for the bar outline. |
| `strokeWidth` | `number` | No | `-` | Stroke width for the bar outline. |
| `style` | `((false \|  \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]>) & ((false \|  \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]>) & ((false \|  \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]>) & (false \|  \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>>)))) \| null` | No | `-` | Custom styles for the root element. |
| `styles` | `{ root?: StyleProp<ViewStyle>; chart?: StyleProp<ViewStyle>; }` | No | `-` | Custom styles for the component. |
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID Used to locate this view in end-to-end tests. |
| `textAlign` | `left \| right \| auto \| center \| justify` | No | `-` | - |
| `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
| `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
| `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
| `top` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `transform` | `string \| readonly (({ scaleX: AnimatableNumericValue; } & { scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scaleY: AnimatableNumericValue; } & { scaleX?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateX: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateY: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ perspective: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotate: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateZ: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scale: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; matrix?: undefined; }) \| ({ matrix: AnimatableNumericValue[]; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; }))[]` | No | `-` | - |
| `transition` | `{ type: timing; } & TimingConfig & { delay?: number \| undefined; } \| { type: spring; } & { mass?: number \| undefined; overshootClamping?: boolean \| undefined; energyThreshold?: number \| undefined; velocity?: number \| undefined; reduceMotion?: ReduceMotion \| undefined; } & { stiffness?: number \| undefined; damping?: number \| undefined; duration?: undefined; dampingRatio?: undefined; clamp?: undefined; } & { delay?: number \| undefined; } \| { type: spring; } & { mass?: number \| undefined; overshootClamping?: boolean \| undefined; energyThreshold?: number \| undefined; velocity?: number \| undefined; reduceMotion?: ReduceMotion \| undefined; } & { stiffness?: undefined; damping?: undefined; duration?: number \| undefined; dampingRatio?: number \| undefined; clamp?: { min?: number \| undefined; max?: number \| undefined; } \| undefined; } & { delay?: number \| undefined; }` | No | `-` | Transition for updates. |
| `transitions` | `{ enter?: BarTransition \| null; enterOpacity?: BarTransition \| null \| undefined; update?: BarTransition \| null \| undefined; } \| undefined` | No | `transitions = {{ enter: { type: 'spring', stiffness: 900, damping: 120, staggerDelay: 250 }, enterOpacity: { type: 'timing', duration: 200 }, update: { type: 'spring', stiffness: 900, damping: 120 } }}` | Transition configuration for enter and update animations. |
| `userSelect` | `none \| auto \| text \| contain \| all` | No | `-` | - |
| `width` | `null \| number \| AnimatedNode \| auto \| ${number}%` | No | `-` | - |
| `xAxis` | `(Partial<CartesianAxisConfigProps> & AxisBaseProps & { GridLineComponent?: LineComponent; LineComponent?: LineComponent \| undefined; TickMarkLineComponent?: LineComponent \| undefined; tickLabelFormatter?: ((value: number) => ChartTextChildren) \| undefined; TickLabelComponent?: AxisTickLabelComponent \| undefined; } & { axisId?: string \| undefined; position?: top \| bottom \| undefined; height?: number \| undefined; }) \| undefined` | No | `-` | Configuration for x-axis. Accepts axis config and axis props. To show the axis, set showXAxis to true. |
| `yAxis` | `(Partial<CartesianAxisConfigProps> & AxisBaseProps & { GridLineComponent?: LineComponent; LineComponent?: LineComponent \| undefined; TickMarkLineComponent?: LineComponent \| undefined; tickLabelFormatter?: ((value: number) => ChartTextChildren) \| undefined; TickLabelComponent?: AxisTickLabelComponent \| undefined; } & { axisId?: string \| undefined; position?: left \| right \| undefined; width?: number \| undefined; }) \| undefined` | No | `-` | Configuration for y-axis. Accepts axis config and axis props. To show the axis, set showYAxis to true. |
| `zIndex` | `number` | No | `-` | - |


