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

<rect> attribute height: Expected length, "NaN". #123

Open
neil0118 opened this issue Oct 30, 2018 · 3 comments
Open

<rect> attribute height: Expected length, "NaN". #123

neil0118 opened this issue Oct 30, 2018 · 3 comments

Comments

@neil0118
Copy link

neil0118 commented Oct 30, 2018

Hi I met an error described as " attribute height: Expected length, "NaN"."
I implemented my Component like this:
<Sparklines data={this.props.data} width={180} height={120} margin={5}> <SparklinesLine color={this.props.color} /> </Sparklines>

react-sparklines version 1.7.0

Can someone help me ?

@sebastian
Copy link

I experience the same error.
The exact error message in Firefox is:

Unexpected value NaN parsing height attribute.

I haven't yet been able to track down the root cause of the issue.

@sebastian
Copy link

sebastian commented Nov 14, 2018

For me at least it only seems to manifest itself when using the SparklinesNormalBand.

My component looks like this:

<Sparklines data={readings} svgHeight={25} svgWidth={190} min={0} max={100}>
  <SparklinesLine />
  <SparklinesNormalBand />
</Sparklines>

If I remove the <SparklinesNormalBand /> the error vanishes.

@yngndrw
Copy link

yngndrw commented Nov 9, 2020

The issue with SparklinesNormalBand is due to a typo on this line:
https://github.com/borisyankov/react-sparklines/blob/master/src/SparklinesNormalBand.js#L26

height={stdev * 2}
Should be:
height={dataStdev * 2}

See: #91 & #114

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