Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotFoundError: Failed to execute 'removeChild' on 'Node' #368

Open
diegocgaona opened this issue Nov 18, 2021 · 3 comments
Open

NotFoundError: Failed to execute 'removeChild' on 'Node' #368

diegocgaona opened this issue Nov 18, 2021 · 3 comments

Comments

@diegocgaona
Copy link

Expected Behaviour

Chart rendered

Actual Behaviour

NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Steps to Reproduce:

When I try to access a page with a chart, it occurs (not always, but almost always)
I'm using the last version (from yarn), with the react wrapper in a project with Reac-Admin.

Some of my code:

import React, { useRef } from "react";
import ReactFrappeChart from "react-frappe-charts";
import useStyles from "../layout/BasicFormStyles"

export function SimpleChart(props) {
  const chartRef = useRef();
  const classes = useStyles(props);
  const { mylabels, myvalues, tooltipXpre, tooltipYpre, chartType, chartTitle, hide } = props

  
 return (
    <div className={classes.chartMarginTop} >
      <ReactFrappeChart
        title={chartTitle}
        ref={chartRef}
        type={chartType}
        colors={["#EFC44F"]}
        axisOptions={{ xAxisMode: "tick", yAxisMode: "tick", xIsSeries: 1 }}
        tooltipOptions={{
          formatTooltipX: (d) => `${tooltipXpre} ${d}`,
          formatTooltipY: (d) => `${tooltipYpre}${d}`
        }}
        lineOptions={{
          regionFill: 1 // default: 0
        }}
        height={250}
        data={{
          labels: mylabels,
          datasets: [{ values: myvalues }],
        }}
      />

  </div>
  );
   
}

In the page (it's inside Box and Cards from material-ui or tabs from React-Admin)

                    <SimpleChart
                        chartTitle="Faturamento R$"
                        mylabels={ chartDataThisYear.chartlabels }
                        myvalues={ chartDataThisYear.chartvalues }                        
                        tooltipXpre={"Data: "}
                        tooltipYpre={"R$"} 
                        hide={hideChart} />

I saw one old issue about it, but to me still ocurring.
And I say this PR #347 which seems related.

NOTE: Add a GIF/Screenshot if required.
image

Frappé Charts version:
Codepen / Codesandbox:

@archfz
Copy link

archfz commented Feb 19, 2022

This seems to be to some extent a react-frappe-charts issue as well. See sheshbabu/react-frappe-charts#34

But the issue is that even with the patch in that issue this reproduces sometimes. So maybe we need a fix in frappe as well.

@k1r0s
Copy link

k1r0s commented Nov 5, 2022

im using frappe-charts@1.6.2 and facing this as well

@k1r0s
Copy link

k1r0s commented Nov 5, 2022

would be nice to check if the svg is indeed child of the container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants