Using Graphics in Calc - The Document Foundation Wiki

Calc Guide
Chapter 5
Using Graphics in Calc
Copyright
This document is Copyright © 2006–2012 by its contributors as listed below. You may distribute it
and/or modify it under the terms of either the GNU General Public License
(http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution
License (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.
All trademarks within this guide belong to their legitimate owners.
Contributors
Barbara Duprey
Jean Hollis Weber
John A Smith
Feedback
Please direct any comments or suggestions about this document to:
documentation@global.libreoffice.org
Acknowledgments
This chapter is based on Chapter 5 of the OpenOffice.org 3.3 Calc Guide. The contributors to that
chapter are:
Jean Hollis Weber
Alexandre Martins
Emma Kirsopp
Kashmira Patel
Peter Kupfer
Iain Roberts
Publication date and software version
Published 17 July 2012. Based on LibreOffice 3.4.6.
Note for Mac users
Some keystrokes and menu items are different on a Mac from those used in Windows and Linux.
The table below gives some common substitutions for the instructions in this chapter. For a more
detailed list, see the application Help.
Windows or Linux
Mac equivalent
Effect
Tools > Options menu
selection
LibreOffice > Preferences
Access setup options
Right-click
Control+click
Opens a context menu
Ctrl (Control)
z (Command)
Used with other keys
F5
Shift+z+F5
Opens the Navigator
F11
z+T
Opens the Styles and Formatting window
Documentation for LibreOffice is available at http://www.libreoffice.org/get-help/documentation
Contents
Copyright.............................................................................................................................. 2
Note for Mac users...............................................................................................................2
Graphics in Calc...................................................................................................................4
Adding graphics (images)...................................................................................................4
Inserting an image file.................................................................................................................. 4
Insert Picture dialog................................................................................................................ 4
Drag and drop......................................................................................................................... 5
Linking an image file.................................................................................................................... 5
Embedding linked images....................................................................................................... 6
Inserting an image from the clipboard.......................................................................................... 7
Inserting an image from the Gallery............................................................................................. 7
Modifying images.................................................................................................................8
Using the Picture toolbar.............................................................................................................. 8
Choosing a graphics mode........................................................................................................ 10
Using graphic filters................................................................................................................... 10
Adjusting colors.......................................................................................................................... 11
Setting transparency.................................................................................................................. 11
Customizing lines, areas, and shadows..................................................................................... 11
Cropping pictures....................................................................................................................... 11
Resizing an image..................................................................................................................... 12
Rotating a picture....................................................................................................................... 13
Using the picture context menu....................................................................................... 13
Text............................................................................................................................................ 13
Position and Size....................................................................................................................... 14
Original Size.............................................................................................................................. 14
Description................................................................................................................................. 14
Name......................................................................................................................................... 14
Flip............................................................................................................................................. 14
Assign Macro............................................................................................................................. 14
Group......................................................................................................................................... 15
Using Calc’s drawing tools............................................................................................... 15
Set or change properties for drawing objects............................................................................. 17
Resizing a drawing object.......................................................................................................... 18
Grouping drawing objects.......................................................................................................... 18
Positioning graphics..........................................................................................................18
Arranging graphics..................................................................................................................... 18
Anchoring graphics.................................................................................................................... 19
Aligning graphics....................................................................................................................... 20
Creating an image map..................................................................................................... 20
Using Graphics in Calc
3
Graphics in Calc
Calc is often used to present data and make forecasts and predictions. Graphics can turn an
average document into a memorable one. Calc can import various vector (line drawing) and raster
(bitmap) file formats. The most commonly used graphic formats are GIF, JPG, PNG, and BMP. See
the Help for a full list of the formats LibreOffice can import.
Graphics in Calc are of three basic types:
• Image files, such as photos, drawings, and scanned images
• Diagrams created using LibreOffice’s drawing tools
• Charts and graphs created using LibreOffice’s Chart facility
This chapter covers images and diagrams. Charts are described in Chapter 3, Creating Charts and
Graphs.
Although using graphics in Calc is very similar to using graphics in any other component of
LibreOffice, this chapter explains some of the differences in their use. It also covers some of the
more advanced graphics functions and how they can further enhance your spreadsheet.
Note
The term graphics refers to both pictures and drawing objects. Often the word
images is used when referring to pictures and other graphics that are not drawing
objects.
Adding graphics (images)
Images (also called pictures in LibreOffice), such as corporate logos and photographs of people
and products, are probably the most common types of graphics added to a Calc document. They
may be downloaded from the Internet, scanned, or created with a graphics program; or they may
be photos taken with a digital camera.
Images can be inserted in four ways:
•
•
•
•
Using the Insert File dialog
By dragging and dropping a supported file
From the gallery
From the clipboard by copying and pasting
Inserting an image file
Perhaps the most common way to insert graphics is to use an existing file.
To insert an image from a file, use either of the following methods:
• Insert Picture dialog
• Drag and drop
Insert Picture dialog
1) Click in the location in the Calc document where you want the image to appear. Do not
worry too much about the exact placement of the image at this stage; placement can be
changed easily as described in “Positioning graphics” on page 18.
2) Choose Insert > Picture > From File from the menu bar, or click the Insert Picture
icon on the Picture toolbar).
4
Using Graphics in Calc
3) On the Insert Picture dialog, navigate to the file to be inserted, select it, and click Open.
Note
The picture is inserted into Calc floating above the cells and anchored to the cell in
which the cursor was placed. See “Positioning graphics” on page 18 for more about
positioning and anchoring graphics.
Figure 1: Inserting a picture from a file
At the bottom of the dialog are two options, Preview and Link. Select Preview to view a thumbnail
of the selected image on the right, so you can verify that you have the correct file. The Link option
is discussed below. When the Link option is not selected, the picture is embedded in the Calc
document.
Note
Your Insert Picture dialog may look quite different from the one shown here,
depending on your operating system and your choice in Tools > Options >
LibreOffice > General of whether to use the LibreOffice Open and Save dialogs.
Drag and drop
1) Open a file browser window and locate the image you want to insert.
2) Drag the image into the Calc document and drop it where you want it to appear. A faint
vertical line marks where the image will be dropped. The picture will be anchored to the cell
where it was dropped.
This method always embeds (saves a copy of) the image file in the Calc document.
Linking an image file
To create a link to the file containing the image instead of saving a copy of the image in the Calc
document, use the Insert picture dialog and select the Link option. The image is then displayed in
the document, but when the document is saved, it contains only a reference to the image file—not
the image itself. The document and the image remain as two separate files, which are merged
temporarily only when you open the document again.
Adding graphics (images)
5
Linking an image has two advantages and one disadvantage:
• Advantage – You can modify the image file separately without changing the document
because the link to the file remains valid, and the modified image will appear when you
next open the document. This can be a big advantage if you (or someone else, perhaps a
graphic artist) is updating images.
• Advantage – Linking can reduce the size of the document when it is saved, because the
image file itself is not included. The file size is usually not a problem on a modern computer
with a reasonable amount of memory, unless the document includes many large graphics
files. Calc can handle quite large files.
• Disadvantage – If you send the document to someone else, or move it to a different
computer, you must also send the image files, or the receiver will not be able to see the
linked images. You need to keep track of the location of the images and make sure the
recipient knows where to put them on another machine, so the Calc document can find
them. For example, you might keep images in a subfolder named Images (under the folder
containing the Calc document); the recipient of the Calc file needs to put the images in a
subfolder with the same name (under the folder containing the Calc document).
Note
When inserting the same image several times in the document, it might appear
beneficial to create links. However, this is not necessary, as LibreOffice embeds
only one copy of the image file in the document. (Deleting one or more of the
copies does not affect the others.)
Embedding linked images
If you originally linked the images, you can easily embed (save in the Calc document) one or more
of them later if you wish. To do so:
1) Open the document in Calc.
2) Choose Edit > Links from the menu bar.
The Edit Links dialog shows all the linked files. In the Source file list, select the files you
want to change from linked to embedded.
3) Click the Break Link button.
Figure 2: The Edit Links dialog
6
Using Graphics in Calc
Note
Going the other way, from embedded to linked, is not so easy—you must delete
and reinsert each image, one at a time, selecting the Link option when you do so.
Inserting an image from the clipboard
Using the clipboard, you can copy images into a Calc document from another Calc document, from
another component of LibreOffice (Writer, Draw, and so on), and from other programs.
To do this:
1) Open both the source document and the Calc document into which you want to copy the
image.
2) In the source document, select the image to be copied.
3) Press Control+C to copy the image to the clipboard.
4) Switch to the Calc window.
5) Click to place the cursor where the graphic is to be inserted.
6) Press Control+V to insert the image.
Caution
If the application from which the graphic was copied is closed before the graphic is
pasted into Calc, the image stored on the clipboard could be lost from the clipboard.
Inserting an image from the Gallery
The Gallery provides a convenient way to group reusable objects such as graphics and sounds
that you can insert into your documents.
The Gallery is available in all components of LibreOffice. It does not come with many graphics, but
you can add your own pictures or find extensions containing more graphics. The Gallery is
explained in more detail in Chapter 11, Graphics, the Gallery, and Fontwork, in the Getting Started
guide. For more about extensions, see Chapter 14, Setting Up and Customizing Calc, in this book.
This section explains the basics of inserting a Gallery image into a Calc document.
1) To open the Gallery (Figure 3), click on the Gallery icon
(located in the right side of the
Standard toolbar) or choose Tools > Gallery from the menu bar.
2) Navigate through the Gallery to find the desired picture.
3) To insert the picture, either right-click on the picture and choose Insert > Copy or click and
drag the picture from the Gallery into the Calc document.
By default, the Gallery is docked above the Calc workspace. To expand the Gallery, position the
pointer over the line that divides it from the top of the workspace. When the pointer changes to
parallel lines with arrows, click and drag downward. The workspace resizes in response.
To expand the Gallery without affecting the workspace, undock it so it floats over the workspace.
To do so, hold down the Control key and double-click on the upper part of the Gallery next to the
View icons. Double-click in the same area while holding down the Control key to dock it again
(restore it to its position over the workspace).
When the Gallery is docked, to hide it and view the full Calc workspace, click the Hide/Show
button in the middle of the thin bar separating the Gallery from the workspace (circled in Figure 3).
To close the Gallery, choose Tools > Gallery to uncheck the Gallery entry, or click on the Gallery
icon again.
Adding graphics (images)
7
Figure 3: Gallery in Calc
Modifying images
When you insert a new image, you may need to modify it to suit the document. This section
describes the use of the Picture toolbar, resizing, cropping, and a workaround for rotating a picture.
Changes made in Calc do not affect the original picture, whether it is embedded or linked.
Calc provides many tools for working with images. These tools are sufficient for most people’s
everyday requirements. However, for professional results it is generally better to use an image
manipulation program such as GIMP to modify images (for example, to crop, resize, rotate, and
change color values) and then insert the result into Calc. GIMP is an open-source graphics
program that can be downloaded from http://www.gimp.org/downloads/.
Using the Picture toolbar
When you insert an image or select one already present in the document, the Picture toolbar
appears. You can set it to always be present (View > Toolbars > Picture). Picture control buttons
from the Picture toolbar can also be added to the Standard Toolbar. See Chapter 14, Setting Up
and Customizing Calc, for more information.
This toolbar can be either floating or docked. Figure 4 shows the Picture toolbar when it is floating.
A brief explanation of the tools is given in Table 1. See the Draw Guide for a more detailed
explanation.
Two other toolbars can be opened from this one: the Graphic Filter toolbar, which can be torn off
and placed elsewhere on the window, and the Color toolbar, which opens as a separate floating
toolbar.
From these three toolbars, you can apply small corrections to the graphic or obtain special effects.
8
Using Graphics in Calc
Figure 4: The Picture Toolbar
Table 1: Picture toolbar functions (from left to right)
Icon
Modifying images
Name
Behavior
From File
Use of this icon is described in “Inserting an image file”
on page 4.
Filter
Displays the Graphic Filter toolbar. See page 10.
Graphics Mode
Provides several color modes in the drop-down list. See
page 10.
Color
Opens the Color toolbar, described on page 11.
Transparency
Sets the transparency of the selected image. See page
11.
Line
Adjusts the border style of the selected image.
Area
Fills an area with the selected color or pattern.
Shadow
Adds a drop shadow to the edges of the picture.
Crop
Opens the Crop dialog, where you can remove a
selected part of the picture. See page 11.
Anchor
Toggles between anchoring the image to the cell or to
the page. See page 19.
Bring to Front
Brings the selected image to the front of the stack. See
page 18.
Send to Back
Pushes the selected image to the rear of the stack. See
page 18.
To Foreground /
Background
Allows image to float in the foreground or makes it part
of the background (behind the cells). See page 18.
Alignment
If two or more pictures are selected, adjusts the
horizontal and vertical alignment of the pictures in
relation to each other. See page 20.
9
Choosing a graphics mode
You can change color images to grayscale by selecting the image and then selecting Grayscale
from the Graphics mode list.
Table 2: Graphics modes
Graphics mode
Behavior
Default
Keeps the picture the same as it was inserted.
Grayscale
Shows the picture in gradual shades of gray.
Black / White
Converts the picture into a monochromatic black and white image.
Watermark
Makes the picture into a watermark that blends into the background.
Using graphic filters
Click the Filter icon
to display the Graphic Filter toolbar, which provides
options for applying basic photographic and effect filters to images from within
Calc. To “tear off” this toolbar and place it anywhere on the screen, click on the
three parallel lines and drag it away.
Table 3: Graphic filters and their effects
Icon
10
Name
Behavior
Invert
Inverts the colors in the picture like a negative.
Smooth
Applies a Gaussian Blur to the image which softens edges.
Sharpen
Sharpens the image.
Remove
Noise
Applies crude noise reduction.
Solarization
Reverses a portion of the tones, then produces pronounced outlines of
the highlights.
Aging
Applies a Sepia filter.
Posterize
Opens a dialog to determine the number of poster colors. This effect is
based on the reduction of the number of colors. It makes photos look
like paintings.
Pop Art
Applies a Pop Art style to the image.
Charcoal
Sketch
Applies a Charcoal Sketch look to the image.
Relief
Displays a dialog for creating reliefs. The position of the imaginary light
source that determines the type of shadow can be chosen.
Mosaic
Joins small groups of pixels into rectangular areas of the same color.
The larger the individual rectangles are, the fewer details the graphic
image has.
Using Graphics in Calc
Caution
Applying LibreOffice picture filters to any image consecutively will progressively
degrade the quality of the image. The picture filters used in Calc utilize what is
known as a Destructive Editing algorithm, whereby each filter is applied to the
image immediately, changing the original data of the image. Successive
transformations result in less and less original data remaining, thus compromising
the quality of the inserted picture. While this might be acceptable for use in simple
documents, it is still recommended that dedicated photo or image editing software
be used to perform anything but the simplest of manipulations.
Adjusting colors
Use the Color toolbar to adjust an image’s red, green, and blue channels
independently, as well as its brightness, contrast and gamma.
Setting transparency
Modify the percentage value in the Transparency box
on the
Picture toolbar to make the image more transparent. This is particularly useful
when creating a watermark or when wrapping an image in the background.
Customizing lines, areas, and shadows
The Line, Area, and Shadow icons open dialogs where you can customize these elements. Details
are in the Draw Guide.
Cropping pictures
When you are only interested in a section of the image for the purpose of your document, you may
wish to crop (hide) parts of it. If you wish to remove (delete) areas of the image it may be a better
choice to use a graphics package.
Click the Crop icon
to open a dialog where you can select which portion of the image you
want to remove from view.
It is not possible to use the mouse to select the area to be cropped, as you can in Draw. Instead, in
the Crop dialog, specify how far from the top, bottom, left and right borders of the image the crop
should be, as illustrated in Figure 5. On the thumbnail in the figure, notice that the cropped
selection is highlighted with an inner rectangle.
On the Crop dialog, you can control the following parameters:
Keep scale / Keep image size
When Keep scale is selected (default), cropping the image does not change the scale of the
picture.
When Keep image size is selected, cropping enlarges (for positive cropping values), shrinks
(for negative cropping values), or distorts of the image so that the image size remains constant.
Left, Right, Top, and Bottom
The image is cropped by the amount entered in these boxes. For example, a value of 3cm in
the Left box cuts 3 cm from the left side of the picture.
• When Keep scale is selected, the size of the image also changes, so in this example the
width will be reduced by 3 cm.
Modifying images
11
• When Keep image size is selected, the remaining part of the image is enlarged (when you
enter positive values for cropping) or shrunk (when you enter negative values for cropping)
so that the width and height of the image is not changed.
Figure 5: The Crop dialog
Width and Height
The Width and Height fields under either Scale or Image size change as you enter values in
the Left, Right, Top, and Bottom fields. Use the thumbnail next to these fields to determine the
correct amount by which to crop.
The cropped shape is always a rectangle; more complex cropped shapes are not possible in Calc.
Instead, use a dedicated photo or image editing software for the job, then import the image into
Calc.
Note
If you crop an image in Calc, the picture itself is not affected. Only the area
displayed is altered. If you export the document to HTML, the full original image is
exported, not the cropped image.
Resizing an image
To resize an image:
1) Click the picture, if necessary, to show the colored resizing handles.
2) Position the pointer over one of the colored resizing handles. The pointer changes shape
giving a graphical representation of the direction of the resizing.
3) Click and drag to resize the picture.
4) Release the mouse button when satisfied with the new size.
The corner handles resize both the width and the height of the graphic object simultaneously, while
the other four handles only resize one dimension at a time.
Tip
12
To retain the original proportions of the graphic, Shift+click one of the corner
handles, then drag. Be sure to release the mouse button before releasing the Shift
key.
Using Graphics in Calc
Resizing a bit-mapped (raster) image such as a photograph adversely affects the resolution,
causing some degree of blurring. It is better to use a graphics package to size your picture
correctly before inserting it into your document, if possible.
For more accurate resizing, use the Position and Size dialog, described on page 14.
Rotating a picture
Select the image, then choose Format > Graphic > Position and Size from the Menu bar, or
right-click the image and select Position and Size from the context menu.
1) Select the Rotation tab on the dialog (Figure 6).
2) In the Pivot point section of the page, select the x-y co-ordinates of the pivot point, from the
left and top edges, using the spin box settings, or set the pivot point in one of the default
positions shown in the selection graphic.
3) In the Rotation angle section, either set the rotation angle in the Angle spin box, or select
one of the 45 degree defaults shown in the selection graphic.
4) If you change your mind, click the Reset button to return the settings to what they were
when the dialog opened.
5) Click OK to rotate the image.
Figure 6: Rotation settings page
Using the picture context menu
Many of the options accessible from the Picture toolbar can also be reached by right-clicking on an
image to pop up a context menu. Some additional options are only available from the context
menu; these are described in this section.
Text
Opens a dialog where you can set the options for text that goes over a picture. To write text over a
graphic, click on the graphic to select it, and then press Enter. There should be a cursor inside the
graphic. Any text entered is part of the graphic, so if the graphic is moved the text will move with it.
Using the picture context menu
13
Position and Size
Opens the dialog shown below where you can change the size, location, rotation, slant and corner
radius of the image.
Figure 7: Position and Size dialog
Original Size
Resets the dimensions of the image to the values when it was originally inserted into the
document.
Description
You can add metadata in the form of a title and description to the image. This information is used
by accessibility tools (such as screen reader software) and as ALT (alternative) attributes if you
export the document to HTML.
Name
You can add a custom name to be assigned to the image, to make it easier to find in the Navigator.
Tip
When collaborating with a team on a large, multi-page publication, it may be
beneficial to give graphics, figures, and other objects meaningful names and
descriptions to aid in clear communication.
Flip
Flips the image either horizontally or vertically.
Assign Macro
Adds programmable functionality to the image. Calc provides rich macro functionality. Macros are
introduced in Chapter 12, Calc Macros.
14
Using Graphics in Calc
Group
To group images:
1) Select one image, then hold down the Shift key and click in turn on each of the others that
you want to include in the group. The invisible “bounding box” (with the 8 colored handles)
expands to include all the selected images.
2) With the images selected, choose Format > Group > Group from the menu bar.
Or hover the mouse pointer over one of the images. When the pointer changes shape from
an arrow to a hand, right-click and choose Group > Group from the context menu.
You cannot include drawing objects in a group with pictures.
Note
After images are grouped, the context menu provides other choices (Ungroup and Edit Group)
and the Format > Group menu includes Ungroup and Enter Group. For more information about
grouping, see the Draw Guide.
Using Calc’s drawing tools
Calc, like the other components of LibreOffice, has a range of tools to create custom drawings.
This chapter covers the default options in Calc. For a more detailed explanation of the drawing
tools and their uses, see the Draw Guide.
In general, if you need to create complex drawings, it is recommended to use LibreOffice Draw or
another drawing program.
To begin using the drawing tools, choose View > Toolbars > Drawing. The Drawing toolbar
appears at the bottom of the screen. You can tear off this toolbar and move it to a convenient place
on the window.
Figure 8: The Drawing toolbar showing default icons
Table 4: Drawing toolbar functions (from left to right)
Icon
Name
Behavior
Select
Selects objects.
Line
Draws a line.
Rectangle
Draws a rectangle. To draw a square, hold down Shift while
you drag.
Ellipse
Draws an ellipse. To draw a circle, hold down Shift while you
drag.
Freeform Line
Draws a freeform line.
Text
Draws a text box with no border.
Using Calc’s drawing tools
15
Icon
Name
Behavior
Callouts
Draws a line that ends in a rectangular callout.
Basic Shapes
Opens the Basic Shapes toolbar.
Symbol Shapes
Opens the Symbol Shapes toolbar.
Block Arrows
Opens the Block Arrows toolbar of shapes.
Flowcharts
Opens the Flowchart toolbar of shapes.
Callouts
Opens the Callouts toolbar of shapes.
Stars
Opens the Stars toolbar of shapes.
Points
Allows editing of the points of a selected polygon.
Fontwork Gallery
Opens the Fontwork Gallery.
From File
Inserts a picture using the Insert Picture dialog.
Extrusion On/Off
Opens the 3-D Setting toolbar and converts the selected
shape (if any) to 3-D.
To display other icons, click the down-arrow at the right-hand end of the toolbar, select Visible
Buttons, and then choose the tools you want to appear on the toolbar.
Icon
16
Name
Behavior
Polygon
Draws a line composed of a series of straight line segments.
Hold down the Shift key to position new points at 45 degree
angles.
Curve
Draws a smooth Bézier curve.
Arc
Draws an arc.
Ellipse Pie
Draws a filled shape that is defined by the arc of an oval and
two radius lines in the current document. To draw a circle pie,
hold down Shift while you drag.
Circle Segment
Draws a filled shape that is defined by the arc of a circle and
a diameter line in the current document. To draw an ellipse
segment, hold down Shift while you drag.
Text Animation
Inserts animated text.
Using Graphics in Calc
If support for Asian languages has been enabled (in Tools > Options > Language Settings >
Languages), two more tools can be added to the Drawing toolbar: Vertical Text and Vertical
Callouts.
To use a drawing tool:
1) Click in the document where you want the drawing to be anchored. You can change the
anchor later, if necessary.
2) Select the tool from the Drawing toolbar (Figure 8). The mouse pointer changes to a crosshair pointer.
3) Move the cross-hair pointer to the place in the document where you want the graphic to
appear and then click-and-drag to create the drawing object. Release the mouse button.
(Some tools have other requirements; see the Help or the Draw Guide for details.)
The selected drawing function remains active, so you can draw another object of the same
type.
4) To cancel the selected drawing function, press the Esc key or click on the Select icon (the
arrow) on the Drawing toolbar.
5) You can now change the properties (fill color, line type and weight, anchoring, and others)
of the drawing object using either the Drawing Object Properties toolbar (Figure 9) or the
choices and dialog boxes reached by right-clicking on the drawing object.
Set or change properties for drawing objects
To set the properties for a drawing object before you draw it:
1) On the Drawing toolbar (Figure 8), click the Select tool.
2) On the Drawing Object Properties toolbar (Figure 9), click on the icon for each property and
select the value you want for that property.
3) For more control, or to define new attributes, you can click on the Area or Line icons on the
toolbar to display detailed dialogs.
These default properties are applied only to the current document and session. They are is not
retained when you close the document, and they do not apply to any other document. The defaults
apply to all the drawing objects except text objects.
To change the properties for an existing drawing object, select the object and continue as
described above.
Other tools and methods for modifying and positioning graphics are described in “Positioning
graphics” below.
1 Line
5 Line Color
9 Change Anchor
13 Alignment
2 Arrow Style
6 Area
10 Bring to Front
3 Line Style
7 Area Style / Filling
11 Send to Back
4 Line Width
8 Rotate
12 To Foreground / To Background
Figure 9. Drawing Object Properties toolbar
Using Calc’s drawing tools
17
Resizing a drawing object
Select the object, click on one of the eight handles around it and drag it to its new size. For a
scaled resizing, select one of the corner handles and keep the Shift key pressed while dragging the
handle.
For more control of the size of the object, use the Position and Size dialog (see “Position and Size”
on page 14) to set the width and height independently. If the Keep ratio option is selected, then
the two dimensions change so that the proportion is maintained, allowing for a scaled resizing.
Grouping drawing objects
To group drawing objects:
1) Select one object, then hold down the Shift key and select the others you want to include in
the group. The bounding box expands to include all the selected objects.
2) With the objects selected, hover the mouse pointer over one of the objects and choose
Format > Group > Group from the menu bar or right-click and choose Group > Group
from the context menu.
Note
You cannot include an embedded or linked graphic in a group with drawing
objects.
Positioning graphics
Graphics can be positioned in LibreOffice Calc to work together and build more complex features.
Arranging graphics
Graphics in a Calc document are maintained in a similar manner to a deck of cards. As you add
more images to the document, each image occupies a new layer at the top of the stack. To arrange
graphics, you tell Calc to change the order of layers in the stack.
Figure 10: Layering effect
18
Using Graphics in Calc
Calc provides several options to re-arrange the order of images. These options can be accessed
from both the Picture toolbar and the picture context menu:
Bring to Front
Places the image on top of any other graphics or text.
Bring Forward
Brings the image one level up in the stack (z-axis). Depending on the number of overlapping
objects, you may need to apply this option several times to obtain the desired result.
Send Backward
The opposite of Bring Forward; sends the selected image one level down in the object stack.
Send to Back
Sends the selected graphic to the bottom of the stack, so that other graphics and text cover it.
To Background and To Foreground
An image or a drawing object can be sent to the background as well. This is not the same as
Bring Forward and Send Backward, which set the order of a number of overlapping graphics.
This feature pushes a graphic behind the cells, allowing cells to be edited without affecting the
graphic.
A graphic in the background will have To Foreground as a menu item, instead of To
Background.
Anchoring graphics
Anchors tell a graphic where to stay in relation to other items.
Anchor to page
Anchoring a graphic to the page allows it to be positioned in a specific place on the page. The
graphic does not move when cells are added or deleted. This is equivalent to an absolute
reference. The graphic will always stay by cell B10 if that is where it is placed.
Anchor to cell
Anchoring a graphic to a cell ensures that the graphic always stays with the content it is
originally anchored to. If a graphic is anchored to cell B10, and a new row is inserted, the
graphic will then be anchored to cell B11. This is equivalent to a relative reference.
For example, in Figure 11 the picture on the left is anchored To Cell B2 (XXX shows where the
picture is anchored). The picture on the right is anchored to the page.
Figure 11: Anchoring 1
Positioning graphics
19
If two rows are inserted above the pictures, the picture anchored to a cell will shift down two rows
and the anchor will change. The picture anchored to the page will not move. This is illustrated in
Figure 12. Note that the anchor symbol and the XXX have moved down to cell B4.
.
Figure 12: Anchoring
Aligning graphics
You can align several graphics relative to each other. To do this:
1) Select all of the graphics to be aligned (Shift+click on each in turn). The graphics will be
surrounded by an invisible bounding box with 8 colored handles.
2) On the Picture toolbar, click on the Alignment icon and select one of the six options.
Or, position the mouse pointer over any of the graphics. When the pointer changes shape
from an arrow to a hand, right-click and choose Alignment, then select from the six
options.
The six options include three for aligning the graphics horizontally (left, center, right) and three for
aligning the graphics vertically (top, center, bottom).
Creating an image map
An image map defines areas of an image (called hotspots) with hyperlinks to web addresses, other
files on the computer, or parts of the same document. Hotspots are the graphic equivalent of text
hyperlinks. Clicking on a hotspot causes Calc to open the linked page in the appropriate program
(for example, the default browser for an HTML page; LibreOffice Calc for a .ODS file; a PDF viewer
for a PDF file). You can create hotspots of various shapes, and include several hotspots in the
same image.
To use the image map editor:
1) In your spreadsheet, select the picture where you want to define the hotspots.
2) Choose Edit > ImageMap from the menu bar. The ImageMap Editor (Figure 13) opens.
3) Use the tools and fields in the dialog (described below) to define the hotspots and links
necessary.
4) Click the Apply icon
to apply the settings.
5) When done, click the Save icon
to save the imagemap to a file, then click the X in the
upper right corner to close the dialog.
20
Using Graphics in Calc
Figure 13: The dialog to create or edit an image map
The main part of the dialog shows the image on which the hotspots are defined. A hotspot is
identified by a line indicating its shape.
The toolbar at the top of the dialog contains the following tools:
• Apply button: click this button to apply the changes.
• Load, Save, and Select icons.
• Tools for drawing a hotspot shape: these tools work in exactly the same way as the
corresponding tools in the Drawing toolbar.
• Edit, Move, Insert, Delete Points: advanced editing tools to manipulate the shape of a
polygon hotspot. Select the Edit Points tool to activate the other tools.
• Active icon: toggles the status of a selected hotspot between active and inactive.
• Macro: associates a macro with the hotspot instead of just associating an hyperlink.
• Properties: sets the hyperlink properties and adds the Name attribute to the hyperlink.
Below the toolbar, specify for the selected hotspot:
• Address: the address pointed by the hyperlink. You can also point to an anchor in a
document; to do this, write the address in this format:
file:///<path>/document_name#anchor_name
• Text: type the text that you want to be displayed when the mouse pointer is moved over the
hotspot.
• Frame: where the target of the hyperlink will open: pick among _blank (opens in a new
browser window), _self (opens in the active browser window), _top or _parent.
Tip
The value _self for the target frame will work just fine in the vast majority of
occasions. It is therefore not recommended to use the other choices unless
absolutely necessary.
Creating an image map
21
Download PDF