question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LineChart does not render

See original GitHub issue

Possible bug or user error.

Trying to render a LineChart but nothing happens

GraphData: [{MSFT: "72.58", date: 1501545600000}, {MSFT: "72.68", date: 1501545600200}, {MSFT: "72.78", date: 1501545600300} ] StockSymbols = ['MSFT'] Code to render chart

<ResponsiveContainer width="100%" height="50%"> <LineChart data={graphData} margin={{ top: 20, right: 30, left: 0, bottom: 0 }}> <XAxis dataKey="date"/> <YAxis /> {stockSymbols.map(name => { return <Line type="monotone" key={name} dataKey={name} stroke="#8884d8"/> })} </LineChart> </ResponsiveContainer>

I believe the data is formatted correctly but I’m not sure as recharts throws no error

recharts v 1.0.0-beta.6 macOS High Sierra 10.13.2 Chrome 63.0.3239.84 and does not work in safari either

Any advice?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
Brunizcommented, Dec 20, 2017

It appears that some fixed hight must be specified to the responsive container. Also it does not complain that the data inputed is not a number. In my case the parseFloat().toFixed(2) changed the value to a string without me knowing.

In my opinion it would be good if recharts could throw an error message or something if it cannot render. This issue was caused by me and can be closed but some lessons learned maybe 😃

0reactions
jamhanparcommented, Jan 27, 2021

Hey, I was having a similar issue and not sure if you were able to fix this. For me, I realized having the data that I want to present inside quotes (i.e. ‘143.14’) doesn’t render the graph. And I see your data also has “72.58” instead of 72.58. I recommend try changing that and see if it works. Hope this helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

recharts Line chart not rendering - Stack Overflow
my LineChartPastYears component, that is supposed to render the chart is not displaying it for a reason I dont manage to understand:
Read more >
Rechart biaxial line chart not rendering - JavaScript
I would like to plot biaxial line chart with X-axis represented by ... However, the data is shown on the screen but lines...
Read more >
Line chart does not show all legend values
Solved: Hi, I created a line chart with 15 legend values, it shows only 12 legend values when expand all levels of hirarchy....
Read more >
[Solved]-React vis Line Chart not rendering properly-Reactjs
[Solved]-React vis Line Chart not rendering properly-Reactjs. Search. score:3. Accepted answer. import "react-vis/dist/style.css";.
Read more >
Line Chart - Google Developers
A line chart that is rendered within the browser using SVG or VML. ... (IE8 and earlier versions don't support SVG, which Material...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found