-
Book Overview & Buying
-
Table Of Contents
Kendo UI Cookbook
By :
In this recipe, we will take a look at how the type and skin of the chart can be changed at runtime. For example, if you have projected a column chart and you want to change it to, say, a line chart, then changes can be made to the series and the chart will be updated. This is useful in cases where you would like to visually represent data in various forms but you can't because of the space constraint. In this recipe, we will construct the chart using the data attributes instead of using the kendoChart function. This is another way of constructing a chart. Also, we will use the Model View ViewModel pattern to make changes to the chart when the user changes its type or skin. This pattern obliterates the use of adding event handlers and, instead, relies on listening to model changes to update the chart dynamically.
Let's create a chart by specifying various options as data attributes:
<div id="chartArea" data-role="chart" data-title="{text...
Change the font size
Change margin width
Change background colour