Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix: rerender chart

kruzhambuseb35ded91bd1
diff --git a/src/pages/Captcha/View/ViewCaptcha.tsx b/src/pages/Captcha/View/ViewCaptcha.tsx
index 1ef737981..2dabec179 100644
--- a/src/pages/Captcha/View/ViewCaptcha.tsx
+++ b/src/pages/Captcha/View/ViewCaptcha.tsx
@@ -230,10 +230,6 @@ const ViewProject = ({
customs,
})
- if (!_isEmpty(mainChart)) {
- mainChart.destroy()
- }
-
setMainChart(() => {
const generete = bb.generate(bbSettings)
generete.data.names(dataNames)
diff --git a/src/pages/Project/View/ViewProject.tsx b/src/pages/Project/View/ViewProject.tsx
index 3fe264bf0..32515b7fb 100644
--- a/src/pages/Project/View/ViewProject.tsx
+++ b/src/pages/Project/View/ViewProject.tsx
@@ -417,11 +417,6 @@ const ViewProject = ({
const applyRegions = !_includes(noRegionPeriods, activePeriod?.period)
const bbSettings = getSettings(chartData, timeBucket, activeChartMetrics, applyRegions, timeFormat, forecasedChartData, rotateXAxias, chartType, events)
-
- if (!_isEmpty(mainChart)) {
- mainChart.destroy()
- }
-
setMainChart(() => {
// @ts-ignore
const generete = bb.generate(bbSettings)
@@ -526,10 +521,6 @@ const ViewProject = ({
})
if (activeTab === PROJECT_TABS.traffic) {
- if (!_isEmpty(mainChart)) {
- mainChart.destroy()
- }
-
setMainChart(() => {
// @ts-ignore
const generete = bb.generate(bbSettings)
@@ -611,10 +602,6 @@ const ViewProject = ({
})
if (activeTab === PROJECT_TABS.performance) {
- if (!_isEmpty(mainChart)) {
- mainChart.destroy()
- }
-
setMainChart(() => {
// @ts-ignore
const generete = bb.generate(bbSettings)
@@ -868,10 +855,6 @@ const ViewProject = ({
const applyRegions = !_includes(noRegionPeriods, activePeriod?.period)
const bbSettings = getSettings(chartData, timeBucket, activeChartMetrics, applyRegions, timeFormat, forecasedChartData, rotateXAxias, chartType, customEventsChartData)
- if (!_isEmpty(mainChart)) {
- mainChart.destroy()
- }
-
setMainChart(() => {
// @ts-ignore
const generete = bb.generate(bbSettings)
@@ -901,10 +884,6 @@ const ViewProject = ({
} else if (!isLoading && !_isEmpty(chartDataPerf) && !_isEmpty(mainChart)) {
const bbSettings = getSettingsPerf(chartDataPerf, timeBucket, activeChartMetricsPerf, rotateXAxias, chartType)
- if (!_isEmpty(mainChart)) {
- mainChart.destroy()
- }
-
setMainChart(() => {
// @ts-ignore
const generete = bb.generate(bbSettings)