Barline Chart

A barline chart component in a UI combines bar and line charts to display different types of data on the same graph. It is especially useful for comparing data trends over time (with the line) alongside discrete data points (with the bars).

TypeResource
DesignFigma
WebWeb Storybook
CodeGitlab

Usage

import { BarLineChart } from 'bio-bind-ui';
<BarLineChart
  data={{
    datasets: [
      {
        backgroundColor: '#008AA0',
        data: [800, 200, 400, 600, 900, 250],
        label: 'Data 1',
        order: 2,
        type: 'bar',
      },
      {
        borderColor: '#E8A800',
        borderWidth: 5,
        data: [850, 600, 100, 300, 200, 300],
        label: 'Data 2',
        order: 1,
        pointBorderWidth: 2,
        type: 'line',
      },
    ],
    labels: ['January', 'February', 'March', 'April', 'May', 'June'],
  }}
  id='bar-line-chart'
  mode='light'
  name='BarLine Chart Horizontal Legend'
  options={{
    plugins: {
      legend: {
        position: 'top',
      },
    },
    scales: {
      x: {
        title: {
          display: true,
          text: 'Month',
        },
      },
      y: {
        max: 1000,
        min: 0,
        title: {
          display: true,
          text: 'Value',
        },
      },
    },
  }}
  size='sm'
  width={700}
/>

Examples

Size (Optional)

Use size for change the size of barline chart component: sm, md, and lg


Legend Position

Use legend position for change position of legend: left or right



Props

PropsRequiredDefaultTypeDescription
idtrue-stringA unique identifier for the chart component. This ID is used for referencing or targeting the chart in other parts of the application.
namefalse-stringThe name of the chart component. This can be used for labeling or identifying the chart within the UI.
datatrue-ChartData<'bar', 'line'>The main data input for the chart. It includes labels for the x-axis and datasets containing the values and styles for the bars or lines.
optionsfalse-ChartOptions<'bar', 'line'>An optional configuration object that allows customization of the chart’s appearance or behavior, such as colors, axis labels, or display preferences.
modefalselightlight, darkThe mode of the chart bar-line. Determines whether the chart uses a light or dark theme.
sizefalsemdsm, md, lgThe size of the chart bar-line. Can be small (sm), medium (md), or large (lg).
widthfalse-numberThe width of the chart bar-line.
heightfalse-numberThe height of the chart bar-line.
BIND © Biofarma Innovate Next-level Design .