Chart Area and Legend Area automatically updates

和自甴很熟 提交于 2019-12-12 02:24:57

问题


I have a chart and implemented seriesClick event. When User clicks it loads dataA, when user click again it loads dataB. It is fully implemented and it is functional. However my question is how to fix chart area and legend area.

Legend length differs in dataA and dataB, therefore when user click on series, chart is not stay stable, it adjusts automatically. I do not want my chart to adjust automatically.

my SeriesClick event implementation is as follows:

     function clickEvent (e) {
             if (!isHover) {
                 chart.options.series = dataSeries2;
                 chart.redraw();
                 isHover = true;
             }
             else if (isHover) {
                 var chart = $("#chart").data("kendoChart");
                 chart.options.series = dataSeries;
                 chart.redraw();
                 isHover = false;
             }
         }

Here is the jsfiddle:

http://jsfiddle.net/3yhbyy2g/72/


回答1:


There is no API yet for setting plot area to have fixed width, all you can do right now is give an escape character (\n) in your legend label.

stats = stats.map(function(x) {
    return { x: x[0], y: x[1], k: x[2],name:"my title\nis too\nlengty" };
});

I found this in their forum, hope that will help you out.



来源:https://stackoverflow.com/questions/30281700/chart-area-and-legend-area-automatically-updates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!