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

Still Not showing all x-axis label, stepped line's Filling when disable Clip #9638

Closed
gerhuy66 opened this issue Sep 9, 2021 · 4 comments
Closed

Comments

@gerhuy66
Copy link

gerhuy66 commented Sep 9, 2021

Hi, I think this is the bug, The chart didn't show all bars when I add too much data that make the chart element very wide.
Then I add the attribute "clip: false" to the chart option and the bars are showing but the x-axis label and the filling part of the stepped line don't.
wide_chart_problem

Expected Behavior

The chart should show all x-axis labels, stepped line filling when I add clip: false in the options.

Current Behavior

Only missing bars were shown in the wide chart.

Possible Solution

Can we fix the clipping problem or apply the "clip: false" to the x-axis label and stepped line filling.

Steps to Reproduce

Please check the example here: https://codepen.io/gerhuy66/pen/qBjrbeE

Context

I'm implementing a horizontal scroll chart that can be contained so many columns. So, this problem prevents me to do it, it's only working fine if the data columns are smaller than 150(actually the canvas width is about 16252 pixels).

Environment

Chart.js version: 3.4.1

@kurkle
Copy link
Member

kurkle commented Sep 13, 2021

You could also limit the visible data segment on a smaller canvas (did not implement the scrollbar, but you can use the same logic for that):
https://codepen.io/kurkle/pen/VwWzvEM

@kurkle
Copy link
Member

kurkle commented Oct 13, 2021

These are browser limitations. Chrome 97 renders everything (the clipping is fixed). Firefox renders nothing. Chrome 94 works as described here.
I don't think we can surpass the canvas element limitations any better that we already did.

Chrome Version 97.0.4668.2 (Official Build) canary (64-bit) (even with clip: false removed)
image

@kurkle
Copy link
Member

kurkle commented Oct 17, 2021

@etimberg should we add a warning, something like:
"Most browsers do not render properly, when canvas dimension exceeds 16384 pixels (current size: WxH)"

@kurkle
Copy link
Member

kurkle commented Nov 17, 2021

Duplicate of #4909

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