Nevron Open Vision Documentation
Chart / Charts / Types / Cartesian / Series / Area Series
In This Topic
    Area Series
    In This Topic

    Area charts depict changes of values, usually over time. They are similar to Line charts, but emphasize the trends by filling the area between axis and line. The following image shows a typical area chart:

     Creating an Area Series

    Area series are represented by the NAreaSeries type. An instance of this type must be added to the series collection of a Cartesian chart:

    Copy Code

    NAreaSeries area = new NAreaSeries();


     Passing Data

    Area series accept data points of type NAreaDataPoint. The following code snippet shows how to add several data points to an area series:

    Copy Code

    area.DataPoints.Add(new NAreaDataPoint(10));

    area.DataPoints.Add(new NAreaDataPoint(20));

    area.DataPoints.Add(new NAreaDataPoint(30));


     Controlling the area origin

    By default the area uses 0 as origin (the area begins from 0). You can modify this behavior by setting the OriginMode property. The following table lists the available options:

    ENSeriesOriginMode Description
    CustomOrigin The series origin value is specified by the Origin property.
    MinValue The series min value is used as a series origin.
    MaxValue The series max value is used as a series origin.
    ScaleMin The min scale value is used as a series origin.
    ScaleMax The max scale value is used as a series origin.


     The following code snippet changes the area origin to 10:

    Copy Code

    area.OriginMode = ENSeriesOriginMode.CustomOrigin;

    area.CustomOrigin = 10;


     Creating a Stacked Area Chart

    A Stacked Area chart displays related data groups, one on top of the other. It is used to show how each group contributes to the total as well as the trends of the total, usually over time. The series are displayed as sequences of straight line segments and the area below each line is filled. Each area series is stacked on top of the previous one. The height of the uppermost line depends on the total value for each category. Stacked Area charts are displayed with several NAreaSeries objects. The MultiAreaMode property of the first area series must be set to ENMultiAreaMode.Series. The MultiAreaMode property of the subsequent area series must be set to ENMultiAreaMode.Stacked or ENMultiAreaMode.StackedPercent. The following example demonstrates how to create a stack area chart with two stacks:

    Copy Code

    // create two area series

    NAreaSeries area1 = new NAreaSeries();


    NAreaSeries area2 = new NAreaSeries();


    // stack the second area over the first one

    area1.MultiAreaMode = ENMultiAreaMode.Series;

    area2.MultiAreaMode = ENMultiAreaMode.Stacked;

    When an area series is stacked it is always displayed with origin 0.
    Stacked percent area charts do not support negative values. All values are internally converted to their absolute values.

    The area series can have an associated palette, in which case the Fill properties of the series / data points is discarded. The following code snippet shows how to apply a palette filling:

    Copy Code

    area.Palette = new NTwoColorPalette(NColor.Red, NColor.Green);

     Formatting Commands

    The area series supports the following formatting commands in addition to the standard (per data point) formatting commands:

    <total> - displays the absolute sum of the values in the current stack.
    <cumulative> - displays the sum of the values up to the current stack value.
    <percent> - displays the percent contribution of the value to the total pile sum.


    See Also