Skip to content

Commit 2a6f093

Browse files
committed
🐛 fixed crash when charts are using the logarithmic scale
1 parent a325ccb commit 2a6f093

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

admin/src/components/ChartbrewCharts/BarChart.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
Tooltip,
1616
Legend,
1717
Filler,
18+
LogarithmicScale,
1819
} from 'chart.js';
1920
import ChartDataLabels from "chartjs-plugin-datalabels";
2021
import { useTheme } from 'styled-components';
@@ -26,7 +27,7 @@ import strapifyChartData from '../../utils/strapifyChartData';
2627
import { getHeightBreakpoint, getWidthBreakpoint } from '../../utils/layoutBreakpoints';
2728

2829
ChartJS.register(
29-
CategoryScale, LinearScale, PointElement, BarElement, Title, Tooltip, Legend, Filler
30+
CategoryScale, LinearScale, LogarithmicScale, PointElement, BarElement, Title, Tooltip, Legend, Filler
3031
);
3132

3233
function BarChart(props) {

admin/src/components/ChartbrewCharts/LineChart.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
Tooltip,
1616
Legend,
1717
Filler,
18+
LogarithmicScale,
1819
} from 'chart.js';
1920
import ChartDataLabels from 'chartjs-plugin-datalabels';
2021
import { useTheme } from 'styled-components';
@@ -24,7 +25,7 @@ import KpiChartSegment from './KpiChartSegment';
2425
import strapifyChartData from '../../utils/strapifyChartData';
2526

2627
ChartJS.register(
27-
CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, Filler
28+
CategoryScale, LinearScale, LogarithmicScale, PointElement, LineElement, Title, Tooltip, Legend, Filler
2829
);
2930

3031
const dataLabelsPlugin = {

0 commit comments

Comments
 (0)