ChartsOrg / ChartsOrg/Charts

Bug on XAxisRenderer's drawLabels

Open
#1,907 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

In drawLabels of XAxisRenderer class,
at line 215, if centeringEnabled, position.x use centeredEntries,
(this position is used both for data and screen, which I think is not very good, but not key point here.)
at line 229, to retrieve **label**, the code just use entries, and not check centeringEnabled.

This will cause the label drawn on chart, is misaligned with actually data point.

Contributor guide

Open the contributing guide

Research direction

Start in XAxisRenderer.drawLabels at the reported lines 215 and 229, and compare how centeredEntries is used for the position with how entries is used to retrieve the label. Done means labels are aligned with their actual data points when centeringEnabled is true; the issue does not name a test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
data-visualization, mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.