Kozea / Kozea/pygal

Value Overlap in pygal.Line - No padding element?

Open
#365 2 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

I am working with a line chart that has data points which overlap. It appears that padding numbers away from lines takes precedent causing this to the best that I can tell. I have looked through the docs but do not see custom styles for padding element or values, and the spacing (http://www.pygal.org/en/stable/documentation/configuration/sizing.html#spacing) does not seem to increase the padding between elements appropriately.

Is this addressed in a non-obvious way that I am missing? Below is code snippet, and attached is highlighting the overlaps.

![padding](https://cloud.githubusercontent.com/assets/6889525/22561387/feea474e-e945-11e6-89c5-0bd996ff4506.png)

```

import pygal
from pygal.style import DefaultStyle

line_chart = pygal.Line(print_values=True,print_zeroes=False, print_values_position='top', style=DefaultStyle)
line_chart.title = 'Test'
line_chart.x_labels = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16']
line_chart.add('test', [6, 10, 17, 25, 27, 33, 47, 61, 76, 93, 93, 91, 83, 90, 81,41])
line_chart.add('test2', [24,14, 57, 63, 71, 71, 80, 82, 90, 94, 96, 88, 96, 100, 97,71])
line_chart.add('test3', [0, 0, 0, 22, 23, 30, 28, 30, 40, 44, 77, 75, 84, 95, 91, 36])
chart = line_chart.render()

return render(request,'test/test.html', {'chart':chart})
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the overlap with the supplied pygal.Line example, including print_values, print_zeroes, print_values_position, and the spacing configuration described in the linked sizing documentation. Trace how line-chart value labels and padding are handled, then establish whether the intended result is a supported configuration or a code change, with a regression test or documentation outcome.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.