PureChart / purechart

Fully customizable HTML/CSS charts for Ruby on Rails 📊
https://docs.purechart.org
MIT License
76 stars 11 forks source link

Add Axis to Line Graph #35

Open GeorgeBerdovskiy opened 5 months ago

GeorgeBerdovskiy commented 5 months ago

Background

Due to PR #34, PureChart finally supports line graphs! However, they are too simple to be used practically. Since points and lines are now being rendered, the next step is to draw labeled x- and y-axes.

Goal

Add axes to the line graph using the image below for guidance. The method you'll be working on is line_graph in lib/purechart/chart_helper.rb.

image

You may use either HTML/CSS or SVG code to accomplish this. Make sure to check the way axes are rendered for lollipop charts before getting started - it may help. Good luck!

GeorgeBerdovskiy commented 5 months ago

Notice that there are no x-axis ticks? That's because line graphs currently take only the y-values and space them out horizontally. This will be changed in the future but don't worry about it until then. If it looks like the picture it's good 😉

matthewh8 commented 5 months ago

i can do this one!