--- title: "Time Series Area Chart" slug: "area-chart" updated: 2023-03-14T03:00:43Z published: 2023-03-14T03:00:43Z canonical: "docs.preset.io/area-chart" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.preset.io/llms.txt > Use this file to discover all available pages before exploring further. # Area Chart The Area Chart visualization type is best used for understanding how ratios, proportions, or percentages change over a dimension (e.g., time). Here are some examples of different area charts: ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/ts_charts.png) ### Reference Content If you're new to visualizing data in Preset, we recommend the following reference articles: - [Creating a Chart](https://portal.document360.io/v1/docs/creating-a-chart): A walkthrough of the overall process of chart selection and creation. - [Using Preset Chart Builder](https://portal.document360.io/v1/docs/using-preset-explore): How to work with the Chart Builder page, the primary interface used when creating a chart. ## **Creating an Area Chart** Preset currently has a few options for area charts in the visualization picker: - Area Chart - Area Chart (legacy) We strongly recommend using the **Area Char****t** visualization type, as it’s newer and supports more features. ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Visualization%20Picker.png) To create an Area Chart, you need to define the following values: - the column you want as the X-axis - the metric(s) you want to visualize on the Y-axis - the column(s) you want the metric(s) to be grouped / categorized by These are all defined in the **Data** tab within Chart Builder. **Simple Area Chart (no dimensions)** Below is a very simple area chart that shows a single metric varying over time. ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-08-24%20at%2011.19.32%20AM.png) Here's an explanation of the selections we made in the chart builder interface to generate this chart. | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Revised%20x-axis(3).png) | **X-axis** - X-axis: Select the column (e.g., Time, Categories) to be visualized. - Time Grain: Define the granularity of the X-axis (Hourly, Daily, Weekly, etc.). The field will appear for temporal dimensions only. | | --- | --- | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/%20Metrics(2).png) | **Metric(s) on Y-axis** - Drag or select the Metric(s) to be visualized on the Y-axis | Here's the SQL query that Preset generated: ```plsql SELECT DATE_TRUNC('DAY', started_at) AS "started_at", count(DISTINCT ride_id) AS "COUNT_DISTINCT(ride_id)" FROM dbt_smukherjee.citibike_trips WHERE started_at >= '2022-04-01 00:00:00.000000' AND started_at < '2022-05-01 00:00:00.000000' GROUP BY DATE_TRUNC('DAY', started_at) ORDER BY "COUNT_DISTINCT(ride_id)" DESC LIMIT 10000 ``` This hopefully helps you understand the mapping from the chart builder options above to the final generated SQL query. **Area Chart (with dimensions)** Below is a similar chart to the one above but with a dimension (rider type) added. ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-08-24%20at%2011.46.06%20AM.png) To generate this chart, we re-used the same selections from the first chart but made the following, additional selections: | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Metrics%20v1%201.png) | **Dimensions** - Select any columns you want to slice/separate the X series objects by. The unique values for those columns will be used to group together values and generate each X series object. | | --- | --- | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-08-24%20at%2011.56.42%20AM.png) | **Customization Options** - **Series Style**: by default, a line is used to connect the data points - **Area Chart Opacity**: increase or decrease to modify how clear the area underneath the line is - **Show Value:** checkbox that enables the display of underlying numeric values if ticked - **Stacked Style:** stack style is ideal when you have a few, non-overlapping groups in your data. The series lines will be "stacked" / separated from each other by the dimensions you selected. - **Only Total:** if selected, only total numeric values are displayed on the topmost line. If unselected, values are shown for each X-series object. - **Extra Controls**: if selected, enables a quick switcher of the stacking type to end-users - **Marker**: if selected, individual data points are shown - **Marker Size**: slider to help you select the size of the markers - **Show Legend**: if selected, the legend containing each dimension and color is shown | Here's the SQL query that Preset generated: ```plsql SELECT DATE_TRUNC('DAY', started_at) AS "started_at", member_casual AS "member_casual", count(DISTINCT ride_id) AS "COUNT_DISTINCT(ride_id)" FROM dbt_smukherjee.citibike_trips WHERE started_at >= '2022-04-01 00:00:00.000000' AND started_at < '2022-05-01 00:00:00.000000' GROUP BY DATE_TRUNC('DAY', started_at), member_casual ORDER BY "COUNT_DISTINCT(ride_id)" DESC LIMIT 10000 ``` ## Advanced Analytics As with most visualizations in Preset, the Area Chart supports **Advanced Analytics** features like: - [Rolling Window and Rolling Function](https://docs.preset.io/v1/docs/rolling-window) - [Time Shift and Resampling](https://docs.preset.io/v1/docs/time-comparison)