Highcharts - 问题与图表回流功能 [英] Highcharts - Issue with the chart reflow function

查看:77
本文介绍了Highcharts - 问题与图表回流功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是 小提琴



我已经在切换边栏时发布了宽度图表。



而我从这个 发布



现在我面临着另一个bug。这是如果我添加一些转换切换边栏。



图表宽度反之亦然。



在上面的小提琴中你可以找到它。



如果我删除转换,它确实可以正常工作。



以下是 小提琴 ,它在没有侧边栏转换的情况下工作正常。



帮助我解决这个问题。



提前。

解决方案

您的时间有问题。
您正试图在动画完成之前重新排列图表。
尝试使用 setTimeout(reflowChart,200),就像我在这里所做的那样: http://jsfiddle.net/hige/J4Uz2/



希望它有帮助! :)

Here's the fiddle.

I had issue width the chart with on toggling the sidebar.

And I got it solved with the help of SO from this post.

Now I'm facing with another bug. That is if I add some transition in toggling the sidebar.

The chart width gets vice-versa.

In the above fiddle you can find it.

If I remove the transition, it does works fine.

Here's the fiddle which works fine without the sidebar transition.

Help me out to solve this bug.

Thanks in advance.

解决方案

You are having an issue with the timing. You are trying to reflow the chart before the animation is finished. Try with setTimeout(reflowChart, 200) as I did here: http://jsfiddle.net/hige/J4Uz2/

Hope it helps! :)

这篇关于Highcharts - 问题与图表回流功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆