Kendo UI 图表未调整大小? [英] Kendo UI chart not resizing?
问题描述
我有一个 Kendo ui 图表,它显示来自动态数据源的柱状图.但有时,图表会打开可用空间的一半大小.当我单击某些链接或更改日期时,它会自行调整大小.知道为什么会导致它吗?
I have a Kendo ui chart which displays a column chart from a dynamic data source. But occassionally, the chart opens half the size of the available space. When I click on some links or change the date, it resizes itself. Any idea why its causing it?
在数据源更改事件中,当它显示此行为时,将容器 div 的宽度显示为 0.如果需要,我可以提供更多细节
In the datasource change event, its showing the container div's width as 0 when it shows this behaviour. I can give more details if needed
我尝试了其中一个答案中给出的刷新方法,但没有帮助
I tried the refresh method as given in one of the answers but its not of help
推荐答案
当您在控制器中获得所有必要的数据后,您可以调用 Javascript CallBack 函数,在该函数中您可以将转换设置为 false,然后重新绘制图表和将 transition 设置为 true,您也可以默认隐藏图表并使其在 Javascript CallBack 函数中可见
When you have got all the necessary data in the controller you can call a Javascript CallBack function in which you can set the transition to false and then redraw the chart and set transition to true, also you can hide the chart by default and make it visible on Javascript CallBack function
这篇关于Kendo UI 图表未调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!