[英]Twitter bootstrap & Highchart: horizontal scroll, responsive
Dear Elders of The Internet - I have created a headache for myself, and I hope you can help :-) 亲爱的互联网长老 - 我为自己制造了一个令人头痛的问题,我希望你能帮忙:-)
This is a two-part questions. 这是一个由两部分组成的问题。 I have a page with three panels, and want a horisontal slide.
我有一个有三个面板的页面,想要一个水平幻灯片。 For this I have created buttons, see live demo here.
为此,我创建了按钮,在这里查看现场演示。
1. Horizontal slide, responsive When clicking top right button "two right panes" I want the page to show just that: the two right panes only . 1.横向滑动,点击响应当右上方按钮“两个右窗格”我希望页面只显示是: 只有两个右窗格。 This is not a problem on large screens, but I cannot get it to work on slightly smaller (media queries and further responsiveness, I think I will be able to figure out).
这在大屏幕上不是问题,但是我不能让它在稍微小一点上工作(媒体查询和进一步的响应,我想我能弄明白)。
Similarly; 同样地; when clicking "single left pane" I would like it to stretch the third (far right) panel, and hide the two others.
单击“单个左窗格”时,我希望它可以拉伸第三个(最右侧)面板,并隐藏其他两个面板。
Clearly, I want it to respond to a 100% viewport. 显然,我希望它能回应100%的视口。
2. Highchart I cannot get the Highchart chart to act accordingly depending on the top left buttons sliding. 2. Highchart我根据左上方的按钮滑动,无法使Highchart图表相应地动作。 The highchart will adjust if I resize the whole window , but I cannot get it to adjust when sliding panels.
如果我调整整个窗口的大小,高图将会调整,但在滑动面板时我无法调整它。 For a demo of a chart that works, scroll down in third panel (this is "homemade" graphs).
有关图表的演示,请在第三个面板中向下滚动(这是“自制”图表)。
I have attempted to illustrate the problem in the screenshots below. 我试图在下面的屏幕截图中说明问题。
(I have posted another question relating to the same page, if you should be so inclined to take a look). (我已经发布了另一个与同一页面有关的问题,如果你应该如此倾向于看一看)。
I suspect it is pretty simple, but I cannot for the life of me see where I went wrong. 我怀疑它很简单,但我不能为我的生活看到我哪里出错了。 Any hints would be much appreciated.
任何提示都将非常感激。 All the best.
祝一切顺利。
Highcharts仅在调整窗口大小时调整大小,如果要调整图表大小,请使用chart.setSize(w,h)
,参见参考 。
Well, good people, I kinda figured it out myself... for the possible benefit of others; 嗯,好人,我有点想到了自己...为了别人可能的利益; my solution was to set the width of the two first columns fixed (or rather; max-width), and thereby using calc to calculate the size of the third columns with minus the two fixed width divs.
我的解决方案是将两个第一列的宽度设置为固定(或者更确切地说是最大宽度),从而使用calc来计算第三列的大小,减去两个固定宽度的div。
width: -webkit-calc(98% - 520px);
width: calc(98% - 520px);
For the Highchart part of the question, much thanks to @Pawel for prompt answer. 对于问题的Highchart部分,非常感谢@Pawel的快速回答。 I haven´t entirely worked it out, as we are currently discussing whether using Highcharts or not is the way to go.
我还没有完全解决这个问题,因为我们目前正在讨论是否使用Highcharts是可行的方法。 If so, I guess I might be back with more questions later.
如果是这样,我想我以后可能会回来提出更多问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.