Ed Sinek
Ed Sinek

Reputation: 4977

KendoUI DataViz - switch between line and bar chart

I've got a requirement to initially show the data in a line chart and have a toggle button that will toggle between a line chart and a bar chart for the data. Is this possible using javascript without going back to the server?

Upvotes: 1

Views: 734

Answers (1)

Robin Giltner
Robin Giltner

Reputation: 3055

Very easy. Just set the series type and call refresh.

var chart = $("#chart").data("kendoChart");
chart.options.series[0].type = "line";
chart.refresh();

http://jsbin.com/oYUs/2/edit

Upvotes: 2

Related Questions