Kozea / Kozea/pygal

Major X labels do not work for dateline

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

Description

Displaying only major labels works fine for me for line graphs, as well as for the Y values on date graphs. However, when I try displaying only makor labels on the X axis, the labels disappear altogether. The example is based on the [XY date sample code](http://www.pygal.org/en/latest/documentation/types/xy.html#date).

```
from datetime import date
dateline = pygal.DateLine(x_label_rotation=25, show_minor_x_labels=False)
dateline.x_labels = [
date(2013, 1, 1),
date(2013, 7, 1),
date(2014, 1, 1),
date(2014, 7, 1),
date(2015, 1, 1),
date(2015, 7, 1)
]
dateline.x_labels_major = [
date(2013, 1, 1),
date(2015, 7, 1)
]
dateline.add("Serie", [
(date(2013, 1, 2), 213),
(date(2013, 8, 2), 281),
(date(2014, 12, 7), 198),
(date(2015, 3, 21), 120)
])
dateline.render()
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked XY date sample and trace how DateLine handles x_labels_major when show_minor_x_labels is false. Reproduce the example, then verify that the major X-axis dates remain visible while minor labels are hidden.

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.