mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 13:29:02 +08:00
fix: Chart.js plugins are not register at each and every render (#303)
This commit is contained in:
parent
9ab1093d81
commit
93b5a945a4
@ -28,6 +28,23 @@ import { useThemeSwitcher } from 'react-css-theme-switcher';
|
|||||||
|
|
||||||
// import Legends from './Legend';
|
// import Legends from './Legend';
|
||||||
// import { LegendsContainer } from './styles';
|
// import { LegendsContainer } from './styles';
|
||||||
|
Chart.register(
|
||||||
|
LineElement,
|
||||||
|
PointElement,
|
||||||
|
LineController,
|
||||||
|
CategoryScale,
|
||||||
|
LinearScale,
|
||||||
|
TimeScale,
|
||||||
|
TimeSeriesScale,
|
||||||
|
Decimation,
|
||||||
|
Filler,
|
||||||
|
Legend,
|
||||||
|
Title,
|
||||||
|
Tooltip,
|
||||||
|
SubTitle,
|
||||||
|
BarController,
|
||||||
|
BarElement,
|
||||||
|
);
|
||||||
|
|
||||||
const Graph = ({
|
const Graph = ({
|
||||||
data,
|
data,
|
||||||
@ -62,24 +79,6 @@ const Graph = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chartRef.current !== null) {
|
if (chartRef.current !== null) {
|
||||||
Chart.register(
|
|
||||||
LineElement,
|
|
||||||
PointElement,
|
|
||||||
LineController,
|
|
||||||
CategoryScale,
|
|
||||||
LinearScale,
|
|
||||||
TimeScale,
|
|
||||||
TimeSeriesScale,
|
|
||||||
Decimation,
|
|
||||||
Filler,
|
|
||||||
Legend,
|
|
||||||
Title,
|
|
||||||
Tooltip,
|
|
||||||
SubTitle,
|
|
||||||
BarController,
|
|
||||||
BarElement,
|
|
||||||
);
|
|
||||||
|
|
||||||
const options: ChartOptions = {
|
const options: ChartOptions = {
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user