How to set X and Y axis in Excel

If you don’t know how to switch the axes, you would’ve deleted the chart and copy-pasted the contents of columns B and C to exchange the values.

There’s a better way than that where you don’t need to change any values.

First, right-click on either of the axes in the chart and click ‘Select Data’ from the options.

A new window will open.

Click ‘Edit’.

Another window will open where you can exchange the values on both axes.

What you have to do is exchange the content of the ‘Series X values’ and ‘Series Y values’.

You can use notepad and copy the values. Then, simply paste them on each form.

Your goal is to change the values from this:

Once you do that, the value series on the axes would be swapped.

Notice that we didn’t change any values on the spreadsheet data at all. All we did was customized the chart.

Axis Type | Axis Titles | Axis Scale

Most chart types have two axes: a horizontal axis (or x-axis) and a vertical axis (or y-axis). This example teaches you how to change the axis type, add axis titles and how to change the scale of the vertical axis.

To create a column chart, execute the following steps.

1. Select the range A1:B7.

2. On the Insert tab, in the Charts group, click the Column symbol.

3. Click Clustered Column.

Result:

Axis Type

Excel also shows the dates between 8/24/2018 and 9/1/2018. To remove these dates, change the axis type from Date axis to Text axis.

1. Right click the horizontal axis, and then click Format Axis.

The Format Axis pane appears.

2. Click Text axis.

Result:

To add a vertical axis title, execute the following steps.

1. Select the chart.

2. Click the + button on the right side of the chart, click the arrow next to Axis Titles and then click the check box next to Primary Vertical.

3. Enter a vertical axis title. For example, Visitors.

Result:

Axis Scale

By default, Excel automatically determines the values on the vertical axis. To change these values, execute the following steps.

1. Right click the vertical axis, and then click Format Axis.

The Format Axis pane appears.

2. Fix the maximum bound to 10000.

3. Fix the major unit to 2000.

Result:

  1. Click anywhere in the chart for which you want to display or hide axes.

    This displays the Chart Tools, adding the Design, and Format tabs.

  2. On the Design tab, click the down arrow next to Add chart elements, and then hover over Axes in the fly-out menu .

  3. Click the type of axis that you want to display or hide.

  1. On a chart, click the axis that has the tick marks and labels that you want to adjust, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. In the Axis Options panel, under Tick Marks, do one or more of the following:

    1. To change the display of major tick marks, in the Major tick mark type box, click the tick mark position that you want.

    2. To change the display of minor tick marks, in the Minor tick mark type drop-down list box, click the tick mark position that you want.

    3. To change the position of the labels, under Labels, click the option that you want.

      Tip    To hide tick marks or tick-mark labels, in the Axis labels box, click None.

  1. On a chart, click the horizontal (category) axis that you want to change, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. Under Axis Options, do one or both of the following:

    1. To change the interval between axis labels, under Interval between labels, click Specify interval unit, and then in the text box, type the number that you want.

      Tip    Type 1 to display a label for every category, 2 to display a label for every other category, 3 to display a label for every third category, and so on.

    2. To change the placement of axis labels, in the Label distance from axis box, type the number that you want.

      Tip    Type a smaller number to place the labels closer to the axis. Type a larger number if you want more distance between the label and the axis.

You can change the alignment of axis labels on both horizontal (category) and vertical (value) axes. When you have multiple-level category labels in your chart, you can change the alignment of all levels of labels. You can also change the amount of space between levels of labels on the horizontal (category) axis.

  1. On a chart, click the axis that has the labels that you want to align differently, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. In the Format Axis dialog box, click Text Options.

  4. Under Text Box, do one or more of the following:

    1. In the Vertical alignment box, click the vertical alignment position that you want.

    2. In the Text direction box, click the text orientation that you want.

    3. In the Custom angle box, select the degree of rotation that you want.

Tip    You can also change the horizontal alignment of axis labels, by clicking the axis, and then click Align Left

, Center
, or Align Right
on the Home toolbar.

You can change the text of category labels on the worksheet, or you can change them directly in the chart.

Change category label text on the worksheet

  1. On the worksheet, click the cell that contains the name of the label that you want to change.

  2. Type the new name, and then press ENTER.

Note    Changes that you make on the worksheet are automatically updated in the chart.

Change the label text in the chart

  1. In the chart, click the horizontal axis, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the horizontal (category) axis.

  2. On the Design tab, in the Data group, click Select Data.

  3. In the Select Data Source dialog box, under Horizontal (Categories) Axis Labels, click Edit.

  4. In the Axis label range box, do one of the following:

    1. Specify the worksheet range that you want to use as category axis labels.

    2. Type the labels that you want to use, separated by commas — for example, Division A, Division B, Division C.

      Note    If you type the label text in the Axis label range box, the category axis label text is no longer linked to a worksheet cell.

  5. Click OK.

You can change the format of text in category axis labels or numbers on the value axis.

Format text

  1. In a chart, right-click the axis that displays the labels that you want to format.

  2. On the Home toolbar, click the formatting options that you want.

Tip    You can also select the axis that displays the labels, and then use the formatting buttons on the Home tab in the Font group.

Format numbers

  1. In a chart, click the axis that displays the numbers that you want to format, or do the following to select the axis from a list of chart elements:

    • Click anywhere in the chart.

      This displays the Chart Tools, adding the Design and Format tabs.

    • On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. Under Axis Options, Click Number, and then in the Category box, select the number format that you want.

    Tip    If the number format you select uses decimal places, you can specify them in the Decimal places box.

  4. To keep numbers linked to the worksheet cells, select the Linked to source check box.

Note    Before you format numbers as a percentage, make sure that the numbers on the chart have been calculated as percentages in the source data, and that they are displayed in decimal format. Percentages are calculated on the worksheet by using the equation amount / total = percentage. For example, if you calculate 10 / 100 = 0.1, and then format 0.1 as a percentage, the number will be correctly displayed as 10%.

  1. Click anywhere in the chart for which you want to display or hide axes.

    This displays the Chart Tools, adding the Design, Layout, and Format tabs.

  2. On the Layout tab, in the Axes group, click Axes.

  3. Click the type of axis that you want to display or hide, and then click the options that you want.

  1. On a chart, click the axis that has the tick marks and labels that you want to adjust, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. Under Axis Options, do one or more of the following:

    1. To change the display of major tick marks, in the Major tick mark type box, click the tick mark position that you want.

    2. To change the display of minor tick marks, in the Minor tick mark type drop-down list box, click the tick mark position that you want.

    3. To change the position of the labels, in the Axis labels box, click the option that you want.

      Tip    To hide tick marks or tick-mark labels, in the Axis labels box, click None.

  1. On a chart, click the horizontal (category) axis that you want to change, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. Under Axis Options, do one or both of the following:

    1. To change the interval between axis labels, under Interval between labels, click Specify interval unit, and then in the text box, type the number that you want.

      Tip    Type 1 to display a label for every category, 2 to display a label for every other category, 3 to display a label for every third category, and so on.

    2. To change the placement of axis labels, in the Label distance from axis box, type the number that you want.

      Tip    Type a smaller number to place the labels closer to the axis. Type a larger number if you want more distance between the label and the axis.

You can change the alignment of axis labels on both horizontal (category) and vertical (value) axes. When you have multiple-level category labels in your chart, you can change the alignment of all levels of labels. You can also change the amount of space between levels of labels on the horizontal (category) axis.

  1. On a chart, click the axis that has the labels that you want to align differently, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. In the Format Axis dialog box, click Alignment.

  4. Under Text layout, do one or more of the following:

    1. In the Vertical alignment box, click the vertical alignment position that you want.

    2. In the Text direction box, click the text orientation that you want.

    3. In the Custom angle box, select the degree of rotation that you want.

Tip    You can also change the horizontal alignment of axis labels, by right-clicking the axis, and then click Align Left

, Center
, or Align Right
on the Mini toolbar.

You can change the text of category labels on the worksheet, or you can change them directly in the chart.

Change category label text on the worksheet

  1. On the worksheet, click the cell that contains the name of the label that you want to change.

  2. Type the new name, and then press ENTER.

Note    Changes that you make on the worksheet are automatically updated in the chart.

Change the label text in the chart

  1. In the chart, click the horizontal axis, or do the following to select the axis from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the horizontal (category) axis.

  2. On the Design tab, in the Data group, click Select Data.

  3. In the Select Data Source dialog box, under Horizontal (Categories) Axis Labels, click Edit.

  4. In the Axis label range box, do one of the following:

    1. Specify the worksheet range that you want to use as category axis labels.

      Tip    You can also click the Collapse Dialog Box button

       , and then select the range that you want to use on the worksheet. When you are finished, click the Expand Dialog Box button.

    2. Type the labels that you want to use, separated by commas — for example, Division A, Division B, Division C.

      Note    If you type the label text in the Axis label range box, the category axis label text is no longer linked to a worksheet cell.

  5. Click OK.

You can change the format of text in category axis labels or numbers on the value axis.

Format text

  1. In a chart, right-click the axis that displays the labels that you want to format.

  2. On the Mini toolbar, click the formatting options that you want.

Tip    You can also select the axis that displays the labels, and then use the formatting buttons on the Home tab in the Font group.

Format numbers

  1. In a chart, click the axis that displays the numbers that you want to format, or do the following to select the axis from a list of chart elements:

    • Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    • On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the axis that you want to select.

  2. On the Format tab, in the Current Selection group, click Format Selection.

  3. Click Number, and then in the Category box, select the number format that you want.

    Tip    If the number format you select uses decimal places, you can specify them in the Decimal places box.

  4. To keep numbers linked to the worksheet cells, select the Linked to source check box.

Note    Before you format numbers as a percentage, make sure that the numbers on the chart have been calculated as percentages in the source data, and that they are displayed in decimal format. Percentages are calculated on the worksheet by using the equation amount / total = percentage. For example, if you calculate 10 / 100 = 0.1, and then format 0.1 as a percentage, the number will be correctly displayed as 10%.

An axis can be formatted to display major and minor tick marks at intervals that you choose.

  1. This step applies to Word for Mac only: On the View menu, click Print Layout.

  2. Click the chart, and then click the Chart Design tab.

  3. Click Add Chart Element > Axes > More Axis Options.

  4. On the Format Axis pane, expand Tick Marks, and then click options for major and minor tick mark types.

    After you add tick marks, you can change the intervals between the tick marks by changing the value in the Interval between marks box.

Postingan terbaru

LIHAT SEMUA