Creating Charts and Graphs
Creating Charts and Graphs
GRAPHS
Chart Wizard
Calc uses a Chart Wizard to create charts or graphs from your spreadsheet data. After the chart
has been created as an object in your spreadsheet, you can then change the chart type, adjust
data ranges and the edit the chart using the functions available in the Chart Wizard. Each change
you make using is automatically reflected in the chart object placed onto your spreadsheet. This
is described in the following sections.
Select the cells containing the data to be included in the chart by highlighting (Figure
59). The selection does not need to be in a single block as in Figure 59; you can also
choose individual cells or groups of cells (columns or rows). See Chapter 1 Introducing
Calc for more information about selecting cells and ranges of cells.
Go to Insert > Chart on the main menu bar, or click the Chart icon on the Standard
toolbar to open the Chart Wizard dialog (Figure 60). A sample chart is created using the
selected data and is placed onto the spreadsheet as an object (Figure 61).
If you want to plot any unconnected rows or columns of data, select the first data
Note series, then hold down the Ctrl key and select the next series. The two data series you
are selecting must be in separate columns or rows. Otherwise Calc will assume that
you are adding to the same data series.
Before opening the Chart Wizard, place the cursor or select a cell anywhere in the
Tip area of the data. The Chart Wizard will then guess the range of the data to create a
sample chart. Just be careful that you have not included the title of your chart when you
make your selection.
To demonstrate the process of creating charts using the following sections, please
Note leave the chart type as 2D column normal.
A data range may consist of more than one region in a spreadsheet, for
example "$Sheet1.A1:A5;$Sheet1.D1:D5" is also a valid data range.
Note If you want a data range of multiple cell areas that are not next to each other, enter
the first range, then manually add a semicolon at the end of the text box, then enter
the other ranges. Use a semicolon as delimiter between ranges.
Data series
On the Data Series page of the Chart Wizard (Figure 63) you can change the source range of all
data series separately, including their labels. You can also change the range of the categories
and remove unnecessary data series or add data series from other cells.
Each named data series has its ranges and its individual Y-values listed. This is useful if you have
very specific requirements for data in your chart, as you can include or leave out these ranges.
In the Data series list box you see a list of all data series in the current chart.
To organize the data series, select an entry in the Data series list.
Click Add to add another data series below the selected entry. The new data series has
the same type as the selected entry.
Click Remove to remove the selected entry from the Data series list.
Use the Up and Down buttons to move the selected entry in the list up or down. This
does not change the order in the data source table, but changes only the arrangement in
the chart.
Chart elements
The chart elements for 2D and 3D charts are shown in Figure 64.
The chart wall contains the graphic of the chart displaying the data.
The chart area is the area surrounding the chart graphic.
The chart floor is only available for 3D charts.
The chart title and subtitle, chart legend, axes labels and axes names are in the chart
area and can be added when using the Chart Wizard to create a chart.
On the Chart Elements page (Figure 65), you can add or change the titles, axes names and grids.
Use a title that draws the attention of viewers to the purpose of the chart and what you want them
to see. Figure 64 shows the various chart elements that can be placed onto a chart.
Enter a title and subtitle you want to use in the Title and Subtitle text boxes. For
example, a better title for this example chart might be The Performance of Motor and
Other Rental Boats.
Enter a name you want to use in the X axis and Y axis text boxes, for example, Thousands
for the Y axis. The Z axis text box is only active if you are creating a 3D chart.
Select the Display legend checkbox and where you want the legend displayed on
your chart – Left, Right, Top or Bottom.
In Display grids, select the X axis or Y axis checkboxes to display a grid on your chart. The
Z axis checkbox is only active if you are creating a 3D chart. Grid lines are not available for
pie charts.
Figure 65: Chart Wizard dialog – selecting and changing chart elements
Clicking Finish closes the Chart Wizard, but the chart is still in edit mode and you
Note can still modify it. Click outside the chart in any cell or a data series to complete
the chart creation.
Go to Format > Chart Type on the main menu bar, or click the Chart Type icon on the
Formatting toolbar, or right-click on the chart and select Chart Type from the context menu
to open the Chart Type dialog. This is similar to the Chart Wizard dialog shown in Figure 60
on page 84.
Select a replacement chart type you want to use. For more information, see
“Selecting chart type” on page 84.
Click OK to close the dialog.
Click outside the chart to leave edit mode.
Legends
To add a legend to your chart:
Select the chart by double-clicking on it to enter edit mode. The chart should now
be surrounded by a gray border.
Go to Insert > Legend on the main menu bar to open the Legend dialog. This dialog is
similar to the Display legend section on the Chart Wizard dialog shown in Figure 65 on
page 87.
Select the Display legend checkbox and where you want the legend displayed on
your chart – Left, Right, Top or Bottom.
Axes
To add an axis to your chart:
Select the chart by double-clicking on it to enter edit mode. The chart should now
be surrounded by a gray border.
Go to Insert > Axes on the main menu bar, or right-click on the chart and select
Insert/Delete Axes from the context menu to open the Axes dialog (Figure 66).
Select the axes checkboxes that you want to use on your chart. The Z axis checkbox is
only active if you are creating a 3D chart.
Click OK to close the dialog.
Click outside the chart to leave edit mode.
To remove an axis from your chart:
Select the chart by double-clicking on it to enter edit mode. The chart should now
be surrounded by a gray border.
Open the Axes dialog as above and deselect the checkboxes for the axes you want
to remove.
Click OK to close the dialog.
Click outside the chart to leave edit mode.
Grids
The visible grid lines can help to estimate the data values in the chart. The distance of the
grid lines corresponds to the interval settings in the Scale tab of the axis properties.
Data labels
Data labels put information about each data point on the chart. They can be very useful for
presenting detailed information, but you need to be careful not to create a chart that is too
cluttered to read.
The text for data labels is taken from the spreadsheet data and it cannot be changed
Note here. If the text needs to be abbreviated, or if it did not label your graph as you
were expecting, you need to change it in the original data table.
Trend lines
When you have a scattered grouping of points in a graph, you may want to show the relationship
of the points by using a trend line. Calc has a good selection of regression types you can use for
The dialog to insert a trend line for a single data series is similar to the dialog for all
Note data series (Figure 68), but has a second page called Line where you can select
the formatting for the trend line (style, color, width, and transparency).
Select the type of trend line that you want to insert – Linear, Logarithmic, Exponential,
or Power.
To show the equation or coefficient of determination used to calculate the trend lines,
select the options Show equation and/or Show coefficient of determination (R2).
Click OK to close the dialog and the trend lines are placed onto your chart.
Click outside the chart to leave edit mode.
To show the equation or the coefficient of determination and the equation after a trend line has
been inserted, right-click on the trend line and select Insert Trend Line Equation or Insert R 2
and Trend Line Equation from the context menu. For more information on the equations, see the
topic Trend Lines in the LibreOffice Calc Help.
When you select a trend line, the information for the trend line is shown in the Status Bar, which
is normally located at the bottom of the spreadsheet.
To delete trend lines from your chart:
Select the chart by double-clicking on it to enter edit mode. The chart should now
be surrounded by a gray border.
To delete all trend lines, go to Insert > Trend Lines on the main menu bar to open
the Trend Lines dialog and select None then click OK.
To delete a single trend line, right-click on the data series and select Delete Trend
line from the context menu.
X or Y error bars
Use the X and Y error bars to display error bars for 2D charts only. If a data series is selected, an
X or Y error bar is inserted for that data series only. If no data series are selected, X or Y error
bars are inserted for all data series.
If your chart has many elements, it is recommended to turn on tooltips in Tools >
Note Options > LibreOffice > General. When you hover a cursor over an element, Calc will
display the element name which will making it easier in selecting the correct element.
The name of the selected element also appears in the Status Bar.
Formatting options
Format Selection – opens a dialog where you can specify the area fill, borders,
transparency, characters, fonts, and other attributes of the selected element on the chart.
Position and Size – opens the Position and Size dialog (see “Position and Size dialog”
on page 106).
Arrangement – provides two options: Bring Forward and Send Backward, of which only
one may be active for some items. Use these options to arrange overlapping data series.
Title – formats the titles for the chart and chart axes.
Legend – formats how the legend appears and positioned on the chart
Axis – formats the lines that create the chart as well as the font of the text that appears
on both the X and Y axes.
If your chart is a 3D chart, then round selection handles appear when a 3D chart
element is selected. These round selection handles control the 3D angle of the
Note element. You cannot resize or reposition the element while the round selection
handles are showing. Use Shift+Click to get the square selection handles and
you can now resize and reposition your 3D chart graphic.
Changing colors
If you want to modify the color scheme from the default, or you want to add extra chart colors for
charts in all your documents, go to Tools > Options > Charts > Default Colors top make the
changes. Changes made in this dialog affect the default chart colors for any chart you make in
the future. See the Getting Started Guide for more information on changing colors.
3D charts
The 3D View dialog (Figure 71) has three pages:
Perspective – where you can change the perspective of the chart.
Appearance – Select whether to use a simple or realistic scheme for your 3D chart.
Illumination – controls the light source that illuminates your 3D chart and where
the shadows will fall.
Appearance
Use the Appearance page to modify some aspects of the appearance of a 3D chart.
Select the chart by double-clicking on it to enter edit mode. The chart should now
be surrounded by a gray border.
Go to Format > 3D View on the main menu bar or right-click in the chart area and
select 3D View from the context menu to open the 3D View dialog (Figure 72).
Click on the Appearance tab to open the page.
Select a scheme from the Scheme drop down list box – Realistic (default) or Simple.
When you select a scheme, the options and the light sources are set accordingly.
Illumination
Use the Illumination page (Figure 73) to set the light sources for the 3D view. See the
Draw Guide for more information on setting the illumination.
Select the chart by double-clicking on it to enter edit mode. The chart should now
be surrounded by a gray border.
Go to Format > 3D View on the main menu bar or right-click in the chart area and
select 3D View from the context menu to open the 3D View dialog (Figure 73).
Click on the Illumination tab to open the page.
Grids
You can divide the axes into sections by assigning gridlines to them. This allows you to get a
better overview of the chart, especially if you are working with large charts. The Y axis major grid
is activated by default.
Use the Grid dialog to set the formatting options for the lines used as grids in your chart by
selecting line style, color, width and transparency. The dialog is similar to the Line page in
the Chart Area dialog shown in Figure 70 on page 97.
Axes
Sometimes you need to have a special scale for one of the axes of your chart, or you need smaller grid
intervals, or you want to change the formatting of the labels on the axis. After highlighting the axis you
wish to change, right-click and choose one of the items from the context menu.
Select the chart by double-clicking on it to enter edit mode. The chart should now
be surrounded by a gray border.
Go to Format > Y Axis or X Axis on the main menu bar and select the axis you want to
format, or right-click in on the chart the axis you want to format and select Format Axis
from the context menu to open the Axis dialog (Figure 74). The options available in the
dialog depend on which axis was selected, type of axis used, type of chart and whether
the chart is 2D or 3D.
Scale
You can enter values for subdividing axes on the Scale page (Figure 74).
Reverse direction – defines where the lower and the higher values are displayed at the
axis. Deselect this option to use a mathematical direction. That means for Cartesian
coordinate systems that the X-axis shows the lower values on the left and the Y-axis
shows the lower values at the bottom. For polar coordinate systems, the mathematical
angle axis direction is counterclockwise and the radial axis is from inner to outer.
Logarithmic scale – specifies that you want the axis to be subdivided logarithmically.
Use this option if you are working with values that differ sharply from each other. You can
use logarithmic scaling to make the grid lines of the axis equidistant but have values that
may increase or decrease.
Minimum – defines the minimum value for the beginning of the axis. Automatic must
be deselected to set this option manually.
Maximum – defines the maximum value for the end of the axis. Automatic must
be deselected to set this option manually.
Major interval – defines the interval for the main division of the axes. The main
interval cannot be larger than the value area. Automatic must be deselected to set this
option manually.
Minor interval count – defines the interval for the subdivision of the axes. Automatic
must be deselected to set this option manually.
Automatic – you must first deselect this option to modify the values. Disable this option
if you are working with fixed values, as it does not permit automatic scaling.
Type – for some types of axes, you can select to format an axis as text or date, or to
detect the type automatically. For a data axis type, you can set the following options.
– Minimum and maximum value to be shown on the ends of the scale.
– Resolution can be set to show days, months, or years as interval steps.
– Major interval can be set to show a certain number of days, months, or years.
– Minor interval can be set to show a certain number of days, months, or years.
Line
Use the Line page to set the formatting options for the axis line by selecting line style, color, width, and
transparency. The dialog is similar to the Chart Area dialog shown in Figure 70 on page 97.
Label
On the Label page (Figure 76), you can decide whether to show or hide the labels, how to
handle them when they will not all fit neatly into one row (for example, if the words are too long),
and whether to have them at an angle to the axis.
Problems may arise in displaying labels if the size of your chart is too small. You can
Note avoid this by either enlarging the view or decreasing the font size.
Numbers
Use the Numbers page to set the attributes for any numbers used on the axis. This page is very
similar to the one for formatting numbers in cells; see Chapter 2 Entering, Editing, and
Formatting Data for more information.
Asian Typography
Sets the Asian typographic options for axis labels and is only available if Enhanced
language support is enabled In Tools > Options > Language Settings.
Apply list of forbidden characters to the beginning and end of line – prevents the
characters in the list from starting or ending a line. The characters are relocated to either
the previous or the next line. To edit the list of restricted characters, go to Tools >
Options > Language Settings > Asian Layout.
Allow hanging punctuation – prevents commas and periods from breaking the line.
Instead, these characters are added to the end of the line, even in the page margin.
Apply spacing between Asian, Latin and Complex text – inserts a space
between Asian, Latin and complex characters.
Interactively
To resize a chart interactively:
Click once on the chart to select it and square selection handles appear around the
border of the chart.
To increase or decrease the size of the chart, click and drag one of the markers. The
cursor indicates the direction in which you can increase or decrease the chart size.
To move a chart interactively:
Click once on the chart to select it and square selection handles appear around the
border of the chart.
Hover the cursor anywhere over the chart until it changes to a move cursor
(shape depends on computer setup).
Click and drag the chart to its new location.
Release the mouse button when the chart is in the required position.
Rotation
The options for the Rotation page (Figure 80) are as follows:
Pivot point – the selected object is rotated around a pivot point that you specify. The
default pivot point is at the center of the object. If you set a pivot point too far outside of
the object boundaries, the object could be rotated off of the page.
– Position X – enter the horizontal distance from the left edge of the page to the pivot
point.
– Position Y – enter the vertical distance from the top edge of the page to the pivot point.
– Default settings – select where you want to place the pivot point on the object. The
default setting is the center of the object.
Rotation angle – specify the number of degrees that you want to rotate the
selected object, or click in the rotation wheel.
– Angle – enter the number of degrees that you want to rotate the selected object.
– Default settings – click and drag the indicator to specify the rotation angle in degrees.
The number of degrees rotated is shown in the Angle box.
Figure 81: Position and Size dialog – Slant & Corner Radius page
Exporting charts
You can export a chart as a graphic that you can use in other documents.
Click once on the chart to select it. Square selection handles appear around the border
of the chart.
Right-click on the selected chart and select Export as graphic from the context menu.
In the Graphics Export dialog that opens, type a name for the graphic file, select the
location where you want to save the file, and select the graphic format you want to use.
Click Save and your chart will be exported as a graphic to the location you specified
and the format you specified.
Column charts
Column charts are commonly used for data that shows trends over time. They are best for charts
that have a relatively small number of data points. It is the default chart type provided by Calc, as
it is one of the most useful charts and the easiest to understand. If you have a large time series, a
line chart would be better suited.
A column chart shows vertical bars, with the height of each bar being proportional to its value.
The X-axis shows categories and the Y-axis shows the value for each category.
Normal – this subtype shows all data values belonging to a category next to each other.
The main focus is on the individual absolute values, compared to every other value.
Stacked – this subtype shows the data values of each category on top of each other. The
main focus is the overall category value and the individual contribution of each value
within its category.
Bar charts
A bar chart shows horizontal bars. The length of each bar is proportional to its value. The Y-axis
shows categories and the X -axis shows the value for each category. The subtypes for bar charts
are the same as for column charts, given above.
Bar charts are excellent for giving an immediate visual impact for data comparison in cases when
time is not an important factor, for example, when comparing the popularity of a few products in a
marketplace. In the examples below:
The first chart is achieved by using the chart wizard with Insert > Grids, deselecting y-
axis, and using Insert > Mean Value Lines.
The second chart is a 3D chart created with a simple border and the 3D chart area
twisted around.
The third chart is an attempt to get rid of the legend and put labels showing the names
of the companies on the axis instead. We also changed the colors to a hatch pattern.
Pie charts
A pie chart shows values as circular sectors of the total circle. The length of the arc, or the area
of each sector, is proportional to its value.
Pie – this subtype shows sectors as colored areas of the total pie, for one data column
only. In the created chart, you can click and drag any sector to separate that sector
from the remaining pie or to join it back.
Exploded pie – this subtype shows the sectors already separated from each other.
You can click and drag any sector to move it along a radial from the pie center.
Donut – this subtype can show multiple data columns. Each data column is shown as
one donut shape with a hole inside, where the next data column can be shown. You can
click and drag an outer sector to move it along a radial from the donut center.
Area charts
An area chart shows values as points on the Y-axis and the X-axis shows categories. The Y
values of each data series are connected by a line and the area between lines is filled with a color.
The focus of an area chart is to emphasize the changes from one category to the next.
Normal – this subtype plots all values as absolute Y values. It first plots the area of the
last column in the data range, then the next to last, and so on, and finally the first column
of data is drawn. Thus, if the values in the first column are higher than other values, the
last drawn area will hide the other areas.
Stacked – this subtypes plots values cumulatively stacked on each other. It ensures that
all values are visible, and no data set is hidden by others. However, the Y values no longer
represent absolute values, except for the last column which is drawn at the bottom of the
stacked areas.
Percent – this subtype plots values cumulatively stacked on each other and scaled
as percentage of the category total.
An area chart is a version of a line or column graph. It may be useful where you wish to emphasize
volume of change. Area charts have a greater visual impact than a line chart, but the data you use
will make a difference.
Figure 85: Area chart examples – the good, the bad, and the ugly
Line charts
A line chart is a time series with a progression. It is ideal for raw data and useful for charts with
plentiful data that show trends or changes over time where you want to emphasize continuity.
On line charts, the X-axis is ideal to represent time series data.
A line chart shows values as points on the Y-axis and the X-axis shows categories. The Y values
of each data series can be connected by a line.
Points only – this subtype plots only points.
Points and lines – this subtype plots points and connects points of the same data
series by a line.
Lines only – this subtype plots only lines.
3D lines – this subtype connects points of the same data series by a 3D line.
Scatter or XY charts
XY (Scatter)
An XY chart in its basic form is based on one data series consisting of a name, a list of X-
values, and a list of Y-values. Each value pair (X & Y) is shown as a point in a coordinate
system. The name of the data series is associated with the Y-values and shown in the legend.
When creating an XY chart refer to the following example tasks. Your XY chart may have
more than one data series.
Scale the X-axis.
Generate a parameter curve, for example a spiral.
Draw the graph of a function.
Explore the statistical association of quantitative variables
XY chart variants
You can select an XY chart variant on the first page of the Chart Wizard, or by choosing Format
> Chart Type for a chart in edit mode.
The chart is created with default settings. After the chart is finished, you can edit its properties to
change the appearance. Line styles and icons can be changed on the Line page of the data
series properties dialog.
Double-click any data point to open the Data Series dialog. In this dialog, you can change
many properties of the data series.
For 2D charts, you can select Insert > Y Error Bars to enable the display of error bars.
You can enable the display of mean value lines and trend lines using commands on the
Insert menu.
Example of XY chart
Scatter charts are great for visualizing data that you have not had time to analyze and they may
be the best for data when you have a constant value against which to compare the data; for
example, weather data, reactions under different acidity levels, conditions at altitude, or any data
which matches two series of numeric data. In contrast to line charts, the X-axis are the left to right
labels, which usually indicate a time series.
Bubble charts
A bubble chart is a specific variation of a scatter chart in which the data points are replaced with
bubbles showing the relations of three variables. Bubble charts are often used to present financial
data or social/demographic data. It shows the relations of three variables in two dimensions. Two
variables are used for the position on the X-axis and Y-axis, while the third is shown as the
relative size of each bubble. One or more data series can be included in a single chart.
The data series dialog for a bubble chart has an entry to define the data range for the bubbles and
their sizes.
It is sometimes easier to build a bubble chart manually in the data range entry section of the chart
wizard. In the example chart shown in Figure 89, the range including the dates and the three
series was highlighted before starting the chart wizard. If you do not include the top row with the
dates, there is no way to include this data as a category later.
The names of the series were added manually, as were the ranges for the second and third series.
Each data series was highlighted and the data points added and formatted to be in the center of the
data point. In this case the number (which is the “dimension”) was deselected and category (the year)
selected. The data points are formatted using the transparency tab with a radial gradient.
If the data series for X-axis contains text, an order number will be displayed in the
Note labels of this axis. Otherwise, the data of the series will be used for the X-axis,
which can lead to irregularly arranged bubbles.
The open, low, high, and closing values of a row build together one data unit in the chart. A stock
price data series consists of several rows containing such data units. The column containing the
transaction volume builds an optional second data series.
Depending on the chosen variant, you may not need all columns.
Legend
The legend displays the labels from the first row or column or from the special range that you
have set in the Data Series dialog. If your chart does not contain labels, the legend displays text
like "Row 1, Row 2, ...", or "Column A, Column B, ..." according to the row number or column letter
of the chart data.
The legend shows the value from the range, which you entered in the Range for Name field in
the Data Range dialog. The default entry is the column header of the closing price column.
Select one of the position options. When the chart is finished, you can specify other positions
using the Format menu.