How to Make an Area Chart in Excel Using ChatGPT
An area chart is based on a line chart, with the area between the line and the x-axis colored to illustrate volume. In this post, we'll explore how to create a standard area chart and a stacked area chart in Excel and how you can use generative AI tools like ChatGPT to accelerate the process.
Don't forget though, you can easily create an area chart for free using Displayr's free area chart maker!
What is an area chart?
An area chart might be considered visually similar to both a line chart and a bar chart. Like a line chart, it uses a line to show trends over time. Meanwhile, like a bar chart, it uses color and shading to represent quantities visually.
However, unlike a line chart, it fills in the space between the line and the X-axis with color or shading to show numeric values, making it ideal for showing cumulative data and comparing quantities. This makes it ideal for showing things like sales, revenue, or population growth.
What we are discussing today is a stacked area chart. Stacked area charts are typically the most commonly used, where multiple lines are stacked on top of each other, and the cumulative total is represented by the uppermost line. These charts are ideal for showing the composition and trends of parts within a whole over time. Stacked area charts are ideal for showing how different subcategories make up the total volume, like sales across different categories or usage of different energy sources.
Setting up the data for the Excel area chart
The easiest way to create an area chart in Excel is to first set up your data as a table. The first column should contain the labels, and the second column contains the values. To create a stacked area chart where the values are split into sub-groups, create a column for each of the sub-groups. In this example, we'll use a data set that shows annual building permits by region for single-unit homes in the US from 1991 through 2016. The following data set shows total permits issued (in thousands) for each region by year. The first column contains the y-axis label (year) with a column for each region. The values in the table represent the number of permits.
Use ChatGPT to make an area chart
One of the most important but time-consuming steps in creating an area chart in Excel is setting up your data. ChatGPT can provide expert guidance on structuring your data. Here are some specific use cases and an example of a prompt you could use to achieve the desired results.
Cleaning the data
Use Case: ChatGPT can directly clean small datasets shared as text or provide Python or Excel formula recommendations for larger datasets. Users can describe specific issues, like missing values, duplicate entries, or inconsistent formatting, and ChatGPT can either clean the data or suggest scripts to automate the process.
Sample Prompt:"Here’s a sample of my dataset:
- Year, Region 1, Region 2
- 2001, 1000, 2000
- 2002, , 3000
- 2003, 1500, 3,000
Can you clean this data for me, standardize the formatting, and replace missing values with the average of their column?"
Note: ChatGPT can not manipulate charts directly and can only analyze relatively small amounts of text data.
Organizing data effectively
Use Case: ChatGPT can guide you in structuring raw data into a proper format for creating an area chart. For example, ensuring that labels (like years) are in the first column and data points (like regional values) are in their respective columns. ChatGPT will give you a visual guideline of what your Excel document needs to look like to turn into a stacked area chart successfully.
Sample Prompt:
"I have raw data showing annual building permits issued in the US from 1991 to 2016, divided by regions. How should I structure it to create an area chart in Excel?"
Optimizing for stacked area charts
Use Case: When working with sub-groups, ChatGPT can explain how to arrange these sub-groups into columns for a stacked area chart. It can also suggest strategies for handling missing or incomplete data.
Sample Prompt:
"I want to create a stacked area chart to show building permits by region over time. How should I organize my data in Excel to ensure each region is correctly displayed in its own column?"
Creating your area chart in Excel
To create an area chart using the above data, highlight the data range (cells A1:B28 in the example above) and select Insert > Charts, select the Line Chart group drop-down menu and then select the second 2-D Area chart option.
The following area chart is created from the selected data. You can modify the properties of the area chart by first selecting the area chart and then going to the Chart options that appear at the top of the menu tool bar. From here you can modify the design and format properties of the chart. In this example, I've added a chart title and changed the legend and axis font size.
To create the above chart, we started with the data and then turned this into an area chart. In Excel, you can also first create the chart object and then provide the data to populate the chart. To do this, first select the area chart from the Insert > Charts menu to select one of the area chart options. This will create an empty area chart object on the sheet. Next, select Chart Tools > Design > Select Data. This opens the Select Data Source dialogue box. Note that the chart object must be selected for the Chart Tools menu to appear.
For Chart data range, select B1:E28 from the example data above. In the Horizontal (Category) Axis Labels section, click the Edit button and select cells A2:A28 and click OK. Excel will create the same chart that was created above. Again, you can modify the chart design and formatting using the Chart Tools menu described above.
Ready to move beyond Excel? There are other ways to create visualizations that offer more advanced options and flexibility. Learn how to create your area chart in Displayr instead!