So you want to build a chart in your React app? If you're like me, the first thing you did was search for something like "react charting library".
...
For further actions, you may consider blocking this person and/or reporting abuse
This is the second "Make your own chart in React" demo I've seen, and both use bar charts. I need line graphs more often; it strikes me that building a line graph (particularly with bezier curves between the points) would be much more challenging to do using React/SVG; or am I mistaken? (I'm not familiar at all with using SVG.)
I very much like this approach and thanks from the very practical explanations! :)
This definitely takes longer time to develop than using a library for most use cases but if the need is very specific it may be easier to build from the scratch than trying to figure out how to the library handles it.
const yRatio = (dataY - dataYMin) / dataYRange;
this will always return 0 for the data with the minimum