简体   繁体   English

是否可以在运行时更改“kendo dataviz”图表类型

[英]Is it possible to change “kendo dataviz” chart type in run time

I have pie chart and I want when I click on the button it would show bar chart. 我有饼图,我想当我单击按钮时它会显示条形图。 Is it possible to do? 有可能吗?

Yes, it is possible, just do: 是的,有可能,只需:

// Get reference to your chart
var chart = $("#chart").data("kendoChart");
// Change type for first serie
chart.options.series[0].type = "bar";
// Finally refresh chart
chart.refresh();

See example here : http://jsfiddle.net/OnaBai/UeWbq/ 请参见此处的示例: http//jsfiddle.net/OnaBai/UeWbq/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM