Skip to main content
MybringDesign System

Charts

Additional communication through visual representation

Charts can typically help users who need to act on information in large datasets. Some examples include representing current status in evolving data and summarise content in large tables.

Guidelines

Using chart.js

We use chart.js and have bundled it with a base config and colours to minimise the need for configuration and repetition.

Install @mybring/charts and react-chartjs-2 using npm or yarn.

import { configureChartJs, colors } from '@mybring/charts'
configureChartJs()

Import colors from @mybring/charts and the chart type from react-chartjs-2 in your respective chart components. The design system source has several examples.

If you need to register plugins that are not included in chart.js, pass them as an array into the configureChartJs function.

configureChartJs([pluginName])
Colours are referenced from the colors object
const data = {
    datasets: [
      {
        backgroundColor: colors.greenLight,
        hoverBackgroundColor: colors.greenLightHover,
      }
    ]
  }

Colour schemes