ChartsOrg / ChartsOrg/Charts

Chart line is jagged with dense, nearly-flat data

Open
#2,478 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I'm using this library to chart dense, nearly-flat data. The y-value of the data is not exactly the same every time, but is very close. When the data gets very dense, strange jagged spikes appear on the graph. What's stranger is that these spikes go away when I increase the height of the graph.

I've pushed a branch which changes the ChartDemo to demonstrate this bug: https://github.com/junelife/Charts/commit/e56cd589209986758218b095483884d8f7d11e7f

Here are screenshots. The first shows the bug, the second has identical data and configuration, but the chartView is twice as tall and the bug doesn't manifest.

![jagged](https://cloud.githubusercontent.com/assets/23319269/26507354/da4fa326-4204-11e7-9732-91e2da1ab112.png)
![clean](https://cloud.githubusercontent.com/assets/23319269/26507357/df998054-4204-11e7-81be-bcea6a895235.png)

Contributor guide

Open the contributing guide

Research direction

Inspect the linked commit e56cd589209986758218b095483884d8f7d11e7f and run its ChartDemo changes with the dense, nearly-flat data. Compare the chart at the two reported heights and trace the rendering path responsible for the jagged spikes. Done means the same data renders without height-dependent spikes.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
data-visualization, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.