Kozea / Kozea/pygal

show_y_guides=False turns off the X axis at y=0 but show_x_guides=False does not turn off the Y axis at x=0

Open
#566 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
419
PR merge metrics
No merged PRs in 30d

Description

show_y_guides=False turns off the dashed horizontal guide lines, but also removes the solid horizontal axis at y=0.
On the other hand, show_x_guides=False still keeps the the vertical axis at x=0.
So this code:

```python
xy_chart = pygal.XY(show_y_guides=False, show_x_guides=False)
xy_chart.add('A', [(-3, -4), (-1, -2), (1, 2), (3, 4)])
xy_chart.render_to_file('xy.svg')
```
results in a graph with a vertical line at x=0 but no horizontal line at y=0.
I think there should be a way to separately turn on/off the axis at zero, independently of the guides.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with pygal.XY(show_y_guides=False, show_x_guides=False) and render_to_file, then trace how guide settings control the axes at zero. Add independent control for the zero axes and a regression test showing that disabling each guide does not unintentionally remove its corresponding axis.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.