- Quick Start
- General Settings
- Special Settings
An area chart is a chart type based on the line chart: it also shows information as a series of data points connected by straight line segments, but the area between the X-axis and the line segments is filled with color or a pattern.
The area chart emphasizes the magnitude of change over time and can be used to highlight the total value across a trend. For example, an area chart displaying profit over time can emphasize the total profit.
This article explains how to create a basic Area chart as well as configure settings that are specific to the type. You can also see the table below to get a brief overview of the Area chart's characteristics:
|Modules||Core + Basic Cartesian / Base|
|Data Fields||x, value|
|Stacked||Stacked Area, Percent Stacked Area|
|Error Bars||Area Chart with Error Bars|
|SUPPORTED CHART PLOTS|
|Polar||Polar Area, Polygon|
|Range Spline Area|
|Range Step Area|
|Chartopedia: Area Chart|
Alternatively, you can use the Base module, which includes, among other things, the two modules mentioned above:
Learn more: Modules.
To create an Area chart, use the anychart.area() chart constructor. If you pass the data to this chart constructor, it creates an Area series.
To create an Area series explicitly, call the area() method.
The following sample demonstrates how a basic Area chart is created:
// create data var data = [ ["January", 10000], ["February", 12000], ["March", 18000], ["April", 11000], ["May", 9000] ]; // create a chart chart = anychart.area(); // create an area series and set the data var series = chart.area(data); // set the container id chart.container("container"); // initiate drawing the chart chart.draw();
In AnyChart there are many settings that are configured in the same way for all chart types, including the Area chart (for example, legend and interactivity settings).
Read the overview of general settings: General Settings.
Combine them with the following methods:
Also, you can use some other methods from anychart.core.StateSettings.
In the sample below, there are two Area series with appearance settings configured:
// create the first series var series1 = chart.area(seriesData_1); // configure the visual settings of the first series series1.normal().fill("#00cc99", 0.3); series1.hovered().fill("#00cc99", 0.1); series1.selected().fill("#00cc99", 0.5); series1.normal().stroke("#00cc99", 1, "10 5", "round"); series1.hovered().stroke("#00cc99", 2, "10 5", "round"); series1.selected().stroke("#00cc99", 4, "10 5", "round"); // create the second series var series2 = chart.area(seriesData_2); // configure the visual settings of the second series series2.normal().fill("#0066cc", 0.3); series2.hovered().fill("#0066cc", 0.1); series2.selected().fill("#0066cc", 0.5); series2.normal().hatchFill("forward-diagonal", "#0066cc", 1, 15); series2.hovered().hatchFill("forward-diagonal", "#0066cc", 1, 15); series2.selected().hatchFill("forward-diagonal", "#0066cc", 1, 15); series2.normal().stroke("#0066cc"); series2.hovered().stroke("#0066cc", 2); series2.selected().stroke("#0066cc", 4);
Labels are text or image elements that can be placed anywhere on any chart (you can enable them on a whole series or in a single point). For text labels, font settings and text formatters are available.
A Tooltip is a text box displayed when a point on a chart is hovered over. There is a number of visual and other settings available: for example, you can edit the text by using font settings and text formatters, change the style of background, adjust the position of a tooltip, and so on.
Stacked and percent stacked charts are multiple-series charts where related values are placed atop one another, which allows comparing the the contribution of a value to a total, either in absolute or percentage terms.
In AnyChart, you can enable a special mode of the scale to make series stack together: see Stacked Charts.
To learn about the stacked versions of the Area chart and its modifications, see:
- Stacked Area
- Percent Stacked Area
- Stacked Spline Area
- Percent Stacked Spline Area
- Stacked Step Area
- Percent Stacked Step Area
Most types of series in AnyChart can be drawn both in horizontal and vertical orientation: Vertical Charts.
Here is information about creating Vertical Area series:
Using AnyChart, you can create 3D versions of some chart types, including the Area chart.
To learn about 3D charts in general, see 3D Charts.
The 3D Area chart is described in the following article: 3D Area Chart