Line charts are two-axis graphs displaying a series of data points with straight line segments connecting them.
Line and smooth line charts are two of more than a dozen different types of charts you can create in Spreadsheet.com. Adding charts to a workbook gives you another way to visualize your data beyond the spreadsheet grid and can help you identify important statistics and trends in your data that may not be obvious when only looking at numbers.
Introduction to Line Charts
Line charts are two-axis graphs displaying a series of data points with straight line segments connecting them. Line charts are used to display time series data and show changes over time for continuous variables and show separate lines for each series. Smooth line charts work the same, but the lines connecting the data points are smooth instead of straight.
Line charts help visualize changes over time for continuous data. You may want to use a smooth line chart to show the growth in cumulative profits over the course of a year, or a line chart to show the change in daily average users for a software product over a few months.
How to Create a New Chart
- Click the Insert chart icon in the toolbar, or select Insert > Chart from the workbook menu
- From the Setup portion of the dialog, select your chart type under the "Type" header
Like all other chart types, you can configure your line and smooth line charts from the Chart settings panel. The panel will automatically appear when you add a new chart to your workbook, or can be opened by clicking the three-dot icon in the top right corner of an existing chart and selecting “Edit chart” from the dropdown, or by double clicking the chart itself.
The Setup section of the Chart settings dialog allows you to specify the data that will be included in your chart. In the example below, we’ll create a line chart to show cumulative profits for three separate regions at monthly intervals for one year. Let’s take a closer look:
Before selecting your X-Axis and Series data, you should determine whether the Data series type is “Row based” or “Column based”.
Whether your chart should use Row based or Column based data depends on two things: (1) what you’re trying to visualize and (2) how your data is organized. Column based data allows you to select columns and ranges of values organized into columns as axis and series values for your chart. Row based data allows you to select rows as axis and series values for your chart.
Which data series type should I use?
Let’s take a look at two sample tables, both with the same data showing the number of units sold for three different products during one week. From this data, we want to create a chart organized by Product # with one series for each day of the week.
If our data was organized like the table on the left, where the Product # values are held in a row, we would select Row based data. We could specify our X-axis or Y-axis as the Product # row and select our subsequent series as each of the five rows underneath, one for each day of a week.
If our data was organized like the table on the right, where the Product # values are held in a column, we would select Column based data. We could specify our X-axis or Y-axis as the Product # column and select our subsequent series as each of the five subsequent columns, one for each day of a week.
In the example above, our X-Axis data is in the form of a column, so we are using column based data.
Once you’ve determined the Data series type, you can select the X-Axis and Series data. If you previously selected row based, you can select rows from each of the dropdowns. Or, if you previously selected column based, you can select columns from the dropdown. As shown above, you can include multiple series in your chart.
For line and smooth line charts, your X-Axis data must be continuous.
For either selection, you also have the option to specify a range of data to include in the chart as opposed to an entire row or column. By using the range option, you can also select data that’s included on a different sheet than that which the chart is created in.
If you have multiple records for each unique variable in your X-Axis, you can aggregate the data and combine those records. You can select the aggregation function next to each series’ name. Here, because we only have one record for each of our variables (months), we are not aggregating the data.
Finally, at the bottom of the dialog, toggle “Use first row as header” (or “Use first column as header” if Row based data is used) to specify whether or not the first row or column of your Series selection should be considered a header row and excluded from the chart data.
If the first row of your selection is the table header row, you do not need to toggle “Use first row as header” as this row will automatically be treated as a header row.
As you select data, your chart will automatically update to reflect your selections, making it easy to check your work as you go and update your selections if necessary. If you make changes to the underlying data, your chart will also reflect those changes automatically.
Once your chart has been set up, you can mouse over the chart at each X-Axis interval and see details about the underlying data.
The Configuration section of the Chart settings dialog allows you to configure the visual appearance of your chart. Let’s take a closer look:
- Chart & axis titles: Assign and format titles for your chart (placed above the chart) and horizontal and vertical axes (places to the left of the chart and below the chart, respectively).
- Series: Change the color assigned to each series of data included in your chart, selected previously in the Setup portion of the Chart settings dialog.
- Legend: Add a series legend to the top, bottom, left, or right of your chart. The legend will inherit the series colors specified previously.
As you change these options, your chart will automatically update to reflect the changes.
Once you've added a title to your chart or labels to your chart axes, you can edit them by double-clicking on the text directly on your chart.
Learn about managing your existing charts, including how to resize, copy, and download them as standalone images. Or, read on to learn more about additional chart types like column charts, bar charts, and pie charts.