Book Image

Kendo UI Cookbook

By : Sagar Ganatra
Book Image

Kendo UI Cookbook

By: Sagar Ganatra

Overview of this book

Table of Contents (18 chapters)
Kendo UI Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Displaying data over a period of time and using aggregate functions


When you work on a data analytics project, you usually come across use cases of plotting a chart, which displays some data over a period of time. For example, in an order-management system, you would like to display the order data and plot it against a period of time. This period could be for a day, week, month, or year. Also, you would like to display data in terms of, say, the average bill value, number of orders, or total business made during the specified period of time.

The Kendo chart library allows you to project the data based on the given period and also apply some of the aggregate functions when displaying this data.

How to do it…

Let's first consider an example dataset that contains the order data:

var orderStats = [{
        billAmount: 80,
        date: new Date('2014/01/01')
    }, {
        billAmount: 95,
        date: new Date('2014/01/01')
    }, {
        billAmount: 100,
        date: new Date('2014/01/01...