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

Pan start region #276

Closed
albmac opened this issue Oct 8, 2019 · 2 comments · Fixed by #487
Closed

Pan start region #276

albmac opened this issue Oct 8, 2019 · 2 comments · Fixed by #487

Comments

@albmac
Copy link

albmac commented Oct 8, 2019

Is it possible to restrict the starting point of a pan action to a certain region of the chart (like only around the middle)?
My problem is that in order to be readable on a smartphone, a chart should have full width, but then scrolling above it triggers a pan.
Having instead a smaller "pan start region" would allow both scrolling and panning.
Is this something you can add in the future?

@albmac
Copy link
Author

albmac commented Oct 8, 2019

Meanwhile I found a workaround: place some transparent rectangles above the chart where it should not be responsive to pan/zoom:

<div class="chart-container">
<canvas id="mycanvas"></canvas>
<div style="position:absolute;left:0;top:0;width:25%;height:100%;background:rgba(0,0,0,0);"></div>
<div style="position:absolute;right:0;top:0;width:25%;height:100%;background:rgba(0,0,0,0);"></div>
</div><br>

Now it will only see the mouse/finger in the central region (25% to 75%)

@JZubero
Copy link

JZubero commented Nov 25, 2020

@albmac Kinda workaroundy but does the trick. This was working for me as well.

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

Successfully merging a pull request may close this issue.

3 participants