Chart Doughnut

Doughnut charts are used to illustrate the proportion or percentage of a whole, by dividing the circle into sections that represent certain parts of the total.

TypeResource
DesignFigma
WebWeb Storybook
CodeGitlab

Usage

import { DoughnutChart } from 'bio-bind-ui';
<DoughnutChart
  data={{
    datasets: [
      {
        backgroundColor: ['#0098B0', '#12B76A', '#FF6E00', '#FFC733'],
        borderWidth: 0,
        data: [700, 400, 300, 200],
        label: 'Dataset',
      },
    ],
    labels: ['Dataset 1', 'Dataset 2', 'Dataset 3', 'Dataset 4'],
  }}
  id='doughnut-chart'
  mode='light'
  options={{
    plugins: {
      legend: {
        position: 'top',
      },
    },
  }}
  showPercentage
  size='sm'
/>

Examples (optional)

Size

Use the size sm, md, or lg to change the size of the doughnut chart.


Mode (optional)

Use the mode light or dark to change the mode of the doughnut chart.


Props

PropsRequiredDefaultTypedescription
idtrue-stringA unique identifier for the doughnut chart.
datafalse-ChartData<'doughnut'>The data object required by Chart.js to render the doughnut chart. It includes labels for the x-axis and datasets containing the values and styles for the doughnut.
optionfalse-ChartOptions<'doughnut'>Optional configuration options for the doughnut chart. These options control the chart behavior, responsiveness, and appearance.
pluginsfalse-Plugin<"doughnut">[]>To host and manage a set of plugins of type doughnut, which can provide additional functionality related to doughnut technology in an application.
modefalselightlight darkThe theme mode of the doughnut chart (light or dark).
sizetruemdsm md lgThe size of the doughnut chart.
widthfalse-numberValue information from the width of the doughnut chart.
heightfalse-numberValue information from the height of the doughnut chart.
showPercentagefalsefalsebooleanIf true, the percentage value will be displayed on the doughnut chart.
hideLegendfalsefalsebooleanIf true, the legend information of the doughnut chart will be hidden.
BIND © Biofarma Innovate Next-level Design .