Stacked Area Chart
Stacks time-series data so that the cumulative and component values are clearly shown.
Interactions
Users can track the exact values at a given time by hovering over the chart. This will show a tracking line and a tooltip with the details for that point in time.
Usage
The first column is the date, time or any other X-axis value. All subsequent columns represent series data. If you have multiple series then there will be one coloured area for each series, with the series name shown in the key.
If you use a date format, the Stacked Area Chart will distribute your data appropriately, so you can miss entries without distorting the timeline. For example, if you have data for Monday to Friday over a number of weeks, the chart will leave a two day gap between Friday and Monday.
Example
Date | Ice cream | Umbrellas | Horse shoes | Pencils | Mugs | Wizard hats | Light bulbs | Fire extinguishers | Wheelbarrows |
---|---|---|---|---|---|---|---|---|---|
01/01/2014 | 1500 | 6500 | 4200 | 2500 | 3200 | 100 | 300 | 200 | 400 |
01/02/2014 | 1045 | 6000 | 4567 | 2537 | 3937 | 103 | 347 | 240 | 200 |
01/03/2014 | 6400 | 1500 | 4908 | 2505 | 3577 | 101 | 328 | 301 | 670 |
01/04/2014 | 1400 | 3500 | 5600 | 2526 | 3403 | 103 | 327 | 340 | 700 |
01/05/2014 | 1000 | 7500 | 6007 | 2572 | 3810 | 108 | 335 | 1040 | 780 |
01/06/2014 | 1090 | 4500 | 5670 | 2585 | 3425 | 100 | 361 | 2708 | 900 |
01/07/2014 | 1010 | 5600 | 6432 | 2595 | 3989 | 104 | 384 | 3500 | 1400 |
01/08/2014 | 5500 | 1400 | 4032 | 2549 | 3914 | 109 | 386 | 3100 | 1300 |
01/09/2014 | 1100 | 8000 | 3002 | 2521 | 3270 | 108 | 396 | 2503 | 1215 |
01/10/2014 | 3400 | 2500 | 1023 | 2521 | 3390 | 108 | 322 | 2190 | 900 |
01/11/2014 | 6000 | 1700 | 900 | 2596 | 3858 | 105 | 355 | 760 | 403 |
01/12/2014 | 6500 | 1000 | 3583 | 2508 | 3478 | 110 | 323 | 300 | 340 |
Options
The following data attributes are available for a Stacked Area Chart.
- data-fm-y-label
- Adds a label to the Y-axis
- data-fm-value-prefix
- Adds a prefix to the values. For example, you may wish to add the ‘£’ symbol before each number
- data-fm-value-suffix
- Adds a suffix to each of your values. For example, you may wish to add the ‘$’ symbol after each number
- data-fm-include-zero
- Forces the Y-axis to include 0
- data-fm-date-format
- Used to interpret time-series data, see the Moment.js docs for format details
- data-fm-percent
- Renders the visualization as a 100% stacked area chart
- data-fm-height
- Enforces an explicit height. Expects a value with CCS syntax, e.g. "250px" (see sizing guide)
- data-fm-width
- Enforces an explicit width. Expects a value with CCS syntax, e.g. "800px" (see sizing guide)
- data-fm-enable-spillover
- If "true", the stacked area chart will draw some transient elements outside of its configured height and width (see layout guide)