Question: Line Graph with Different data model
See original GitHub issueIs it possible to get an example with a nested set of data?
My data for example is formatted as follows:
{reportData: [{ key: 2010, values: [{ reportMonth: 1, data: value }, { reportMonth: 2, data: value2 }...]},{ key: 2011, values: [{ reportMonth: 1, data: value }...]} ]
Where I want to display a LineChart with a line corresponding to each key. and the XAxis spanning the 12 months of the year. Been struggling to figure out how to pass the data / dataKey into the library.
I have also tried with my data formatted like:
{reportData: [{reportMonth: 1, data: value1, reportYear: 2010}, {reportMonth: 2, data: value2, reportYear: 2010}..., {reportMonth: 1, data: value1, reportYear: 2011}...,]}
But was unable to get the graph to display as I desired…
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
A Complete Guide to Line Charts | Tutorial by Chartio
Line charts are a fundamental chart type generally used to show change in values across time. Learn how to best use this chart...
Read more >How To Create A Line Graph In Excel (With Multiple Lines)
... I will show you how to create a line graph in Excel. I will firstly show you how to create a simple...
Read more >Graphing two data sets on the same graph with Excel - YouTube
Show how to use MS Excel 2013 to plot two linear data sets on the same graph so that they can be visually...
Read more >Combining chart types, adding a second axis - Microsoft
Combining different chart types · 1. Click the Total Transactions data column in the chart. · 2. Once you have selected the Total...
Read more >How to Make A Line Graph In Excel With Two Sets Of Data
It can help analyze future trends. Using line graphs in MS Excel, you can determine future trends and predictions using different models.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In our use of ReCharts, we have always “massaged” the data before passing it in. ReCharts has a simple, if not super-flexible, expectation of what it wants to see, but that isn’t much different than any other charting package we looked at. But we’ve always found that doing that extra step was fairly straightforward, since you can easily insert a “transform” function in between ReCharts and the underlying data.
Yes, but it will require a custom label function that returns the value of labelx.