How to edit the legend in a chart. Formatting charts and graphs in Word

To begin with, this is the task. Colleagues today asked us to increase the marker size in the pie chart legend without changing the font. Something like this:

This is a pie chart generated automatically. The only thing I changed was the position of the legend (I moved it to the right side of the diagram).

As you can see, the markers in the legend are very small. It’s very easy to enlarge them - select the legend and increase the font:

As a result, the markers grew larger, but the inscriptions also became obscenely large. Is it possible to enlarge just the markers?

To be honest, I don't know the right answer to this question. If someday some Excel guru reads this entry, please answer what official science says about this. I didn’t find the right solution “head-on”, but I found a workaround. It turns out that if you select not the entire legend, but a separate element of it, changing the font will look slightly different - for the selected element both the marker and the inscription will increase, and for the rest only the marker.

To take advantage of this fact, we need an additional, “extra” legend element. Let's create it. To do this, stretch the chart data range down one line. The added line will not contain any data or title, but in the legend it will be assigned its own color (yellow in my case):

Let's change this color to transparent (to do this, select the legend element, go into its properties and in the "fill" section mark "no fill")

The element has now become invisible. Without leaving the element's properties, let's increase its font:

As you can see, the markers are enlarged, but the font of the inscriptions is not. We received standard pie chart with a standard legend and large, convenient markers, the color of which will not be lost when printing, resizing, etc.

It is not always possible to immediately create a graph and chart in Excel that meets all user requirements.

Initially, it is difficult to determine which type of graphs and charts is best to present data in: a volumetric chart, a stacked bar chart, or a chart with markers.

Sometimes the legend is more of a hindrance than a help in presenting the data and it is better to turn it off. And sometimes you need to connect a table with data to the graph to prepare a presentation in other programs (for example, PowerPoint). Therefore, it is worth learning how to use the settings for graphs and charts in Excel.

Changing graphs and charts

Create a table with data as shown below. You already know how to build a graph in Excel using data. Select the table with the data and select the “Insert” - “Histogram” - “Histogram with Grouping” tool.

The result is a graph that needs to be edited:

  • remove legend;
  • add table;
  • change chart type.


Chart legend in Excel

You can add a legend to the chart. To solve this problem we perform the following sequence of actions:

  1. Left-click on the graph to activate it (select it) and select the tool: “Working with Charts” - “Layout” - “Legend”.
  2. From the Legend tool's drop-down list of options, select the option: "None (Do not add legend)." And the legend will be removed from the chart.

Table on graph

Now you need to add a table to the chart:

  1. Activate the graph by clicking on it and select the “Chart Tools” - “Layout” - “Data Table” tool.
  2. From the drop-down list of options for the “Data Table” tool, select the option: “Show Data Table”.

Types of graphs in Excel

  1. Select the “Chart Tools” - “Design” - “Change Chart Type” tool.
  2. In the “Change chart type” dialog box that appears, specify the names of groups of chart types in the left column - “With areas”, and in the right section of the window select “With areas and stacking”.

For complete completion, you still need to label the axes on the Excel graph. To do this, select the tool: “Working with Charts” - “Layout” - “Axis Titles” - “Name of the Main Vertical Axis” - “Vertical Title”.


Near the vertical axis there is a place for its title. To change the vertical axis title text, double-click on it with the left mouse button and enter your text.

Delete the schedule to move on to the next task. To do this, activate it and press the key on the keyboard – DELETE.

How to change the color of a graph in Excel?

Based on the original table, create a graph again: “Insert” - “Histogram” - “Histogram with grouping”.

Now our task is to change the fill of the first column to gradient:



Tools for complex design of gradient fills on charts are now available to you:

  • name of the workpiece;
  • direction;
  • corner;
  • gradient points;
  • color;
  • brightness;
  • transparency.

Experiment with these settings, and then click “Close”. Please note in the "Name of the workpiece" are already available ready-made templates: flame, ocean, gold, etc.

How to change data in Excel graph?

A graph in Excel is not a static picture. There is a constant connection between the graph and the data. When the data changes, the “picture” dynamically adapts to the changes and thus displays the current indicators.

We will demonstrate the dynamic connection of a graph with data using a ready-made example. Change the values ​​in the cells of the range B2:C4 of the original table and you will see that the indicators are automatically redrawn. All indicators are automatically updated. It's very convenient. There is no need to re-create the histogram.

You need to change the text of the chart title, to do this:

    Left-click to select the chart title.

    Inside the frame that appears, press the left mouse button again, as a result of which the frame will disappear and a blinking cursor will appear in the text.

    Place the cursor after the word “prices” and enter the text: “product”.

    Left-click anywhere in the diagram when you are finished entering text.

Note: You can also change the text of the chart title using the F2 function key, which must be pressed after the title is highlighted. In this case, a blinking cursor appears in the formula bar at the top of the screen. This method is convenient in case of complete replacement of the chart title. When you finish entering the text, you need to press the Enter key, as a result of which the edited name will appear on the diagram.

Axis format

To customize the axis display, you can change the appearance of the axis line, the scale scale, and the font, alignment, and number format of the categories (the labels next to the axis labels).

Axis image needs to be adjusted Y. To do this:

    Select axis Y, to do this, click the left mouse button, placing the pointer either on the axis itself or on the numeric values ​​next to it.

    Select menu command Format|Highlighted axis.

    View, in option Axis choose other and change the line thickness by placing the cursor in the options Thickness for the third option. Leave the line type unchanged, and select the color in the corresponding option according to your taste (do not choose too light colors). On the right side of the tab View There are options that allow you to change the image of the axis tick marks and the location of the tick marks. Here in the option Basic, choose Outward, in option IntermediateNo, and in the option Tick ​​marksnear With axis.

    On the tab Scale The parameters are set automatically during the chart creation process.

    On the tab Font in option Typeface choose Ordinary, in option Size set size to 9.

    On the tab Number place cursor on format general(as axis labels Y numbers appear that show the scale of the data series reflected in the diagram, and the values ​​of the data points are determined by the height of the column).

    Press the button OK.

    Pointing the mouse cursor at the name of the axis (the inscription “Indicators” to the left of the axis), click the left mouse button.

    Without moving the mouse pointer, right-click and select the item in the context menu that appears Format titles axes.

    In the dialog box that opens, on the tab View in option Frame choose invisible, on the tab Font in option Typeface choose bold, in option Size– 9 and press OK.

To set the axis display X:

    Select axis X.

    Right-click, open the context menu and select the command Axis format.

    In the dialog box that appears, on the tab Font in option Typeface choose Bold, in option Size set character height to 8 and click OK.

    Setting the display of the axis name X carry out in the same way as setting the display of the axis name Y.

Legend Format

Not all chart types require a legend. For example, pie and three-dimensional charts are built without a legend. If the generated diagram should not contain a legend, and the option Add legend in the process of creating a diagram using Masters diagrams has not been disabled, the legend can be removed directly from the diagram.

To remove the legend from the histogram, to do this:

    Select a legend by left-clicking in an empty space within the frame around it.

    Press key Delete on the keyboard.

The legend disappeared from the histogram image, and the entire chart area remained selected.

Note: You can also delete the legend using the context menu, where you need to select the command Clear.

Since this type of graph implies the presence of a legend, it is necessary to restore the legend removed from the histogram, for this:

    Make sure that the entire chart area is selected (otherwise it needs to be selected).

    Select menu item Chart|Options diagrams.

    On the tab Legend enable option Add legend, and in the option Accommodation choose right. Click OK.

Note: You can click the button to restore the legend immediately after it has been deleted. Cancel on the standard toolbar (blue left arrow). Removing and restoring the legend is also carried out using the panel Diagrams.

Using the dialog box Format legends You can change the location of the legend, the appearance of the frame around it, and the font of the legend elements.

You need to configure the display of the legend, to do this:

    Place the mouse cursor on the legend and double-click on the left button.

    In the dialog box that opens Legend Format on the tab Font in option Typeface choose italics, in option Size set character height to 9.

    On the tab View Set the frame display parameters to your liking.

    On the tab Accommodation familiarize yourself with the legend placement options and leave the option as selected Right, in the middle.

    Click OK.

Note: You can also change the placement of the legend on the diagram using the mouse by selecting the legend and holding down the left button in the frame area around it and moving the legend.

To change the size of the frame around the legend, you need to select the legend on the diagram, place the mouse pointer on any of the markers that appear along the perimeter of the frame and move the cursor (in the form of a double-headed arrow) in the desired direction while holding down the left button.

You need to change the size of the frame around the legend, to do this:

    Select legend.

    Reduce the size of the frame so that the text of its elements is fully visible.

To change the text of legend elements, you need to edit the text in the corresponding table cells.

It is necessary to change the text of the second element of the legend (“Markup”), to do this:

    Place the mouse cursor in a cell C2 in the table.

    Using the keyboard, enter the text “Markup Amount” instead of the existing column name.

    Click Enter.

    Make sure that the text of the first legend element in the chart has also changed.

Most likely, you will not be satisfied with the diagram that is generated by default. The Microsoft Graph module provides extensive formatting options. You can choose a chart type, change the color of data series, add titles, move the legend, customize axes and their scales and tick marks, add data labels, and change many advanced settings that affect how the data is presented. Using a chart based on a Word table as an example, this exercise will explore just some of the formatting techniques available.

1. To modify the graph, you need to open the Microsoft Graph module again. To do this, double-click on the diagram.

2. Click the button Table mode hide the Graph data table. We will not change the data now. A Graph data table is similar to an Excel sheet.

3. In the toolbar Standard Expand the chart type button palette and select the appropriate type, for example Schedule.

Note Microsoft Graph chart formatting techniques are similar to Excel chart formatting techniques.

Note If you are not happy with the chart types presented in the toolbar button palette, select the command Chart > Chart Type. A dialog box will open, the first tab of which offers more than a hundred standard chart options to choose from, and the second tab gives the user the opportunity to design his own chart type.

4. The chart legend is located inconveniently, let's move it down. To do this, right-click on the legend and select context menu team Legend Format and on the tab Accommodation in the dialog box that opens, select the switch position Down, in the middle. Then click on the button OK.

5. Grab the bottom right handle of the diagram's outline rectangle with your mouse and drag it down to the right to make the diagram a little larger, as shown in Fig. 7.19.

Now let's dress up the axis labels, change the grid against which the graph is plotted, and enlarge the data markers so they're easier to see.

6. Double-click the graph's vertical axis label numbers. In the dialog window that opens, expand the tab Scale, shown in Fig. 7.20.

7. Uncheck boxes Maximum value And Price of main divisions to turn off automatic adjustment of these settings.

8. In the fields of the same name after the checkboxes, enter the numbers 80 and 20, respectively.

9. Click the button OK. Four other tabs in the Axes Formatting dialog box allow you to customize the appearance of the axes, the font of the tick marks, the number format of the labels, and their alignment mode.

10. To remove the gray background of the graph, select the command Diagram >, which opens the chart options dialog box. The six tabs in this window contain the following options:

Rice. 7.19. Formatting a Chart in Word

* Headings- names of the diagram, vertical and horizontal axes;
* Axles- display modes for category and value axes;
* Grid lines- checkboxes for enabling and disabling vertical and horizontal grid lines of the chart background;
* Legend- display mode and location of the chart legend;
* Data Signatures- a switch that makes it possible to display various signatures next to data markers;
* Data table- checkboxes for setting the display mode of the table of displayed data under the horizontal axis of the chart.

11. On the Grid Lines tab, shown in Fig. 7.21, clear the checkbox Main lines in the Y Axis (Values) section.

12. Check the box of the same name in the X Axis (categories) section.

13. Click a button OK close the dialog window. Horizontal grid lines will be replaced with vertical ones.

14. Click on the chart area. On the menu Format select the first command. Its name begins with the word Dedicated, followed by the name of the selected element. In this situation it will be the command Selected chart area.

Rice. 7.20. Formatting a chart's axes

15. In the dialog box that opens, select the position Transparent switch Fill to unfill the chart. Then click on the button OK.

Rice. 7.21. Chart options

16. To exit graph editing mode and close the Microsoft Graph module, click in an empty space in the Word document. Now the table and graph will look as shown in Fig. 7.22.

17. Save the document, it will be useful in the test exercise.

Rice. 7.22. Final view of the chart in Word

There are 3 ways to do this:

1. Define string names directly

Right-click on the chart and click Select Data, then edit the series names directly as shown below.

You can specify the values ​​directly, e.g. Series 1 or specify a range, for example. =A2

2. Create a chart that defines the top series and axis labels

Just select your data range (in the same format as I did) and create a simple histogram. Labels should be detected automatically.

3. Define Legend (Series Names) Using VBA

Likewise, you can define series names dynamically using VBA. Simple example below:

ActiveChart.ChartArea.Select ActiveChart.FullSeriesCollection(1).Name = "=""Hello"""

This will override the title first. Just change the index from (1) to eg. (2) etc. to change the names of the following episodes. What does VBA do above? It sets the series name to Hello , since "=""Hello""" translates to ="Hello" (" must be escaped by the previous ").