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

Why drawValues is outside of clipping contentRect #1727

Closed
liuxuan30 opened this issue Oct 27, 2016 · 1 comment
Closed

Why drawValues is outside of clipping contentRect #1727

liuxuan30 opened this issue Oct 27, 2016 · 1 comment

Comments

@liuxuan30
Copy link
Member

liuxuan30 commented Oct 27, 2016

@danielgindi I notice in ChartsDemo,
renderer!.drawValues(context: context) is after context.restoreGState() so the value labels are not clipped, and when zooming and scrolling, the value text will be drawn out of contentRect, which seems strange.

Is there any purpose for this?

I am working on fixing the boundary check for drawValues, but I realize we could abandon all the checks but let clipping contentRect do the job.

@danielgindi
Copy link
Collaborator

Yes!
Look at the Line Chart 2 demo. The values there should obviously bleed out of the content rect.

There's bounds check for drawling values, to not draw values for points which are not visible on the screen. So instead of being clipped at a certain point, you'll see that scrolling the chart will cause the values to hide abruptly.

We should probably add a flag for clipping the values too.

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

No branches or pull requests

2 participants