Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Before we render our horizontal axis, we have to remember about scales. Scales are functions that are responsible for mapping data values to visual variables. I don't want to dive too deep into this topic, but if you're interested in further reading, you can check out scales documentation. We want our x-axis to display labels from data, so for this we will use scaleBand.
I did some research and found a lot of helpful libraries e.g. recharts or react-vis, but I thought for my case it would be an overkill, also it seems like a great opportunity to learn something new, so I've decided to use D3.
D3 stands for Data-Driven Documents and as the docs states: