Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jagged lines sticking out from behind data point circles #5031

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gsbernstein
Copy link

@gsbernstein gsbernstein commented Mar 23, 2023

Goals ⚽

Prevent jagged lines from sticking out from behind the data points

Before After
jagged Simulator Screen Shot - iPhone 14 - 2023-03-23 at 11 10 00

Implementation Details 🚧

I tried subclassing the LineChartRenderer to override drawLinear() but it's difficult because _xBounds and _lineSegments are internal protected.

Because this disconnects each line segment, I limited it only to the case where there's a data point circle covering the line join. If we want to be stricter about that check, we could also make sure that the circle size is greater than the line width, and that the color of the circle is fully opaque.

I also have a fix for the case where the disjoint isn't covered up, see [improve-jagged-lines-extra](https://github.com/gsbernstein/Charts/pull/1/files)

Testing Details 🔍

  • demo app

# Conflicts:
#	Source/Charts/Renderers/LineChartRenderer.swift
@gsbernstein gsbernstein changed the title better Fix jagged lines sticking out from behind points Mar 23, 2023
@gsbernstein gsbernstein changed the title Fix jagged lines sticking out from behind points Fix jagged lines sticking out from behind data point circles Mar 23, 2023
@gsbernstein
Copy link
Author

@pmairoldi — what is the best way to get a review for this? Should I update my commits? Do I need an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant