React Bootstrap Charts
React Charts - Bootstrap 4 & Material Design
Note: This documentation is for an older version of Bootstrap (v.4). A
newer version is available for Bootstrap 5. We recommend migrating to the latest version of our product - Material Design for
Bootstrap 5.
Go to docs v.5
At your disposal are 6 types of charts and multiple options for customization.
Line chart
Radar chart
Bar chart
Horizontal Bar Chart
Polar Area Chart
Pie Chart
Doughnut Chart
Bubble Chart
Scatter Chart
Minimalist charts MDB Pro component
Sales
ROI
Conversion
React Charts - API
In this section, you will find advanced information about the Line, Radar, Bar, Polar, Pie, Doughnut
components. You will learn which modules are required in this component, what are the possibilities of configuring the component, and what events and methods you can use in working with it.
API Reference: Options
In order to use Charts components make sure you have imported proper module first.
The table below shows the configuration options of the components.
Line
Name | Type | Default | Description | Example |
---|---|---|---|---|
showLines |
Boolean | true |
If false, the lines between points are not drawn. |
showLines: false
|
spanGaps |
Boolean | false |
If false, NaN data causes a break in the line. |
spanGaps: true
|
scales |
Object | - |
Changes the scale settings in the charts |
scales: {
yAxes: [
{
ticks: {
max: 100,
min: -100
}
}
]
}
|
Radar
Name | Type | Default | Description | Example |
---|---|---|---|---|
scale |
Object | - |
Changes the scale settings in the charts |
scale: {
display: false,
ticks: { max: 250 }
}
|
startAngle |
number | -0.5 * Math.PI |
Starting angle to draw arcs for the first item in a dataset. | startAngle: 3 * Math.PI |
Bar
Name | Type | Default | Description | Example |
---|---|---|---|---|
scales |
Object | - |
Changes the scale settings in the charts |
scales: {
yAxes: [
{
ticks: {
max: 100,
min: -100
}
}
]
}
|
Polar
Name | Type | Default | Description | Example |
---|---|---|---|---|
startAngle |
number | -0.5 * Math.PI |
Starting angle to draw arcs for the first item in a dataset. | startAngle: 3 * Math.PI |
animation.animateRotate |
Boolean | true |
If true, the chart will animate in with a rotation animation. This property is in the options.animation object. | animation: { animateRotate: false } |
animation.animateScale |
Boolean | true |
If true, will animate scaling the chart from the center outwards. | animation: { animateScale: false } |
scale |
Object | - |
Changes the scale settings in the charts |
scale: {
display: false,
ticks: { max: 250 }
}
|
Doughnut & Pie
Name | Type | Default | Description | Example |
---|---|---|---|---|
rotation |
number | -0.5 * Math.PI |
Starting angle to draw arcs from. | rotation: 3 * Math.PI |
circumference |
number | 2 * Math.PI |
Sweep to allow arcs to cover. |
circumference: 3 * Math.PI
|
animation.animateRotate |
Boolean | true |
If true, the chart will animate in with a rotation animation. This property is in the options.animation object. |
animation: {
animateRotate: false
}
|
animation.animateScale |
Boolean | true |
If true, will animate scaling the chart from the center outwards. |
animation: {
animateScale: false
}
|
cutoutPercentage |
number | 50 - for doughnut, 0 - for pie |
The percentage of the chart that is cut out of the middle. | cutoutPercentage: 30 |
MDBSimpleChart - Component MDB Pro component
In this section, you will find advanced information about the MDBSimpleChart component. You will learn which modules are required in this component, what are the possibilities of configuring the component, and what events and methods you can use in working with it.
Import statement
In order to use MDBSimpleChart component make sure you have imported proper module first.
API Reference: Properties MDB Pro component
The table below shows the configuration options of the MDBSimpleChart component.
Name | Type | Default | Description | Example |
---|---|---|---|---|
width |
number | 150 |
Chart width | <MDBSimpleChart width={100} > |
height |
number | 150 |
Chart height | <MDBSimpleChart height="100" > |
strokeWidth |
number | 10 |
The stroke width of the chart in pixels. | <MDBSimpleChart strokeWidth={4} > |
strokeColor |
string | '#408AE5' |
The stroke colour of the charts. | <MDBSimpleChart strokeColor="#4FB64E" > |
labelFontWeight |
string | 'bold' |
Label font weight | <MDBSimpleChart labelFontWeight="light" > |
labelFontSize |
string | '1.2em' |
Label font size | <MDBSimpleChart labelFontSize="2rem" > |
fillColor |
string | 'none' |
The fill color whithin the circle. | <MDBSimpleChart fillColor="red" > |
percent |
number | 'none' |
The percentage shown on the chart | <MDBSimpleChart percent={56} > |