Angular Area and Vertical Area Charts
Area charts and Vertical Area charts are categorical charts that display quantitative data using continuous lines passing through points defined by item values. The portion of the graph beneath the lines is filled with a particular color for each series. The different colors in an Area Chart are useful for emphasizing changes in values, which come from several sets of similar data.
Binding to Data
You can bind the Area chart series to an array through the data property in three formats:
-
Binding to numbers—Use a simple array of numeric values where each number represents a data point value. The chart auto-generates categories.
tspublic data: number[] = [10, 25, 15, 30, 20]; -
Binding to arrays—Use arrays of
[value, category]pairs where the first element is the data point value and the second element is the category name.tspublic data: [number, string][] = [[10, 'Jan'], [25, 'Feb'], [15, 'Mar']]; -
Binding to objects—Use an array of objects with custom properties.
tspublic data: Array<{ value: number; category: string }> = [ { value: 10, category: 'Jan' }, { value: 25, category: 'Feb' }, { value: 15, category: 'Mar' } ];When binding to objects, specify which properties contain the data through the following field mappings:
Property Data type Required Description fieldstringYes* The property name that contains the numeric value (*required when binding to objects). categoryFieldstringNo The property name that contains the category with string,date, ornumbervalues.
The following example demonstrates how to bind the Area chart series to data using object models.
Sub-Types
The Area chart features the following sub-types:
Vertical Area Charts
Vertical Area charts transpose the axes—the category axis is vertical and the value axis is horizontal. Vertical Area charts are functionally equivalent to Area charts.
Stacked Area Charts
Stacked Area Charts are suitable for indicating the proportion of individual values to the total. To select this series sub-type, set the stack property of the first series item to true. The setting of the stack property is applied to all series and you do not have to set the rest of the series explicitly.
The following example demonstrates how to stack the red and green series on top of each other. The blue series contains positive and zero values as well as a negative one. In all cases, the plotted value is the sum of all values up to the current series.
100% Stacked Area Charts
100% Stacked Area Charts are suitable for indicating the proportion of individual values as a percentage of the total. To select this series sub-type, set the stack property of the first series item to a { type: '100%' } object. The setting of the stack property is applied to all series and you do not have to set the rest of the series explicitly.
While it is possible to plot negative values in a 100% stacked chart, the results are hard for the user to interpret.
The following example demonstrates how the series data is converted into percentages.
Angular Area Chart Line Style
Angular Area Charts enable you to render the lines between the points in different styles. To set the appearance of the lines, use the line.style option which provides the following available styles:
- Normal—The default style, which produces a straight line between data points.
- Step—The style renders the connection between the data points through vertical and horizontal lines. It is suitable for indicating that the value is constant between the changes.
- Smooth—The style causes the Angular Area Chart to display a fitted curve through data points. It is suitable for displaying data with a curve and connecting the points with smooth instead of straight lines.
The following Angular Area Chart example demonstrates how to use the different types of lines.
Support and Learning Resources
- Area and Vertical Area Chart Homepage
- Getting Started with the Kendo UI for Angular Chart
- API Reference of the Charts
- Bar Charts
- Box Plot Charts
- Bullet Charts
- Line Charts
- Radar Charts
- RangeArea Charts
- RangeBar Charts
- Waterfall Charts
- Getting Started with Kendo UI for Angular (Online Guide)
- Getting Started with Kendo UI for Angular (Video Tutorial)
- Video Courses
- Chart Forum
- Before You Start: All Things Angular (Telerik Blog Post)
- Knowledge Base