iScroll 4 和 highcharts 兼容性问题
我正在尝试将 highcharts 库与 iScroll4 一起使用。您可以在此处查看完整示例。
如您所见,问题是浏览器忽略了外部 div 的宽度,并且 iScroll div 显然根本不显示。
我想要实现的是在宽度=200px的容器内有一个宽度=1000px的图表。当然,我希望图表可以滚动(水平),以便我可以看到所有图表,而不仅仅是左侧部分。为此,我想使用 iScroll4,因为我已经在同一项目中使用它来实现另一个功能。
你能指出我的代码中的问题出在哪里吗?
多谢!
i'm trying to use the highcharts library with iScroll4. You can see a complete example here.
The problem as you can see is that the outer div's width is getting ignored by the browser and the iScroll div apparently doesn't show at all.
What i want to achieve is having a graph with width=1000px inside a container with width=200px. Of course i want the graph to be scrollable (horizontally) so that i can see all the graph and not only the left part. To do this, i want to use iScroll4 as i already used it inside the same project for another feature.
Can you point out where the problem is in my code?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想这可以帮助你。
http://jsfiddle.net/pn5SW/5/
你必须为div设置overflow-x: 。尝试使用 #charts div 下面的空间进行滚动(纵向模式)。
Highcharts 使用 ios 的触摸事件,它们阻止默认事件,您可以尝试像这样的替代解决方案。 http://jsfiddle.net/HXUmK/126/
I think this could help you.
http://jsfiddle.net/pn5SW/5/
you have to set overflow-x: for div. try to scroll using the space below #charts div (portrait mode).
Highcharts to use touch events of the ios, they prevent the default events, you may try this alternative solution like this. http://jsfiddle.net/HXUmK/126/