Creating charts

You can create a chart from the dashboard view or by using Metrics Explorer. Typically, Metrics Explorer is used when investigating specific issues or prototyping. However, you can save charts created in this manner to a dashboard. Charts on a dashboard are persistent and are part of a set of monitoring tools.

This page focuses on building charts from the dashboard view. If you are interested in Metrics Explorer, see Using Metrics Explorer.

Charts can display any metric type, any custom metric, and any logs-based metric provided the data type is numeric. Charts cannot graph string-type data. The following screenshot is an example of a line chart in color mode. For these charts, a unique color is assigned to each time series.

Example of a line chart in color mode.

Before you begin

Ensure that you have one of the roles described in Authorization.

Designing charts

The process of designing a chart involves two tasks:

  • Specifying the data to appear on the chart.
  • Configuring the appearance of the chart.

These task are indicated by the two tabs on a chart-definition page as seen in the following screenshot:

Display the chart-definition tabs.

  • The Metric tab is where you specify the data that you want to appear on the chart; for an in-depth discussion, see Selecting Metrics.
  • The View options tab is where you specify the appearance of the chart itself; this is described in Setting View Options.

In addition, a chart on a dashboard gets a name; this is represented by the Chart Title value in the previous screenshot.

Adding a chart to a dashboard

To create a new chart on a dashboard, do the following:

  1. In the Cloud Console, select Monitoring or click the following button:

    Go to Monitoring

  2. In the Monitoring navigation panel, click Dashboards:

    • If the dashboard exists, then double-click the name of the dashboard.
    • Otherwise, click Create dashboard.
  3. In the detail view for a dashboard, click Add Chart:

    Show the dashboard toolbar.

  4. Specify the data to appear on the chart:

    1. Ensure the Metric tab is selected.

      Display the metric-selection tab.

    2. Complete the Find resource type and metric box. You can select values from the menus, or you can enter the name.

    3. (Optional) Select a subset of the data by using the Filter field.

    4. (Optional) Modify the default aggregation settings. The aggregation fields define how multiple time series are combined and how each time series is processed.

      • To group time series by a label, use the Group By field. Selecting a value for this field automatically selects a value for the Aggregator field.
      • To specify how multiple time series are combined, set the Aggregator field.
      • To configure the processing algorithm for individual time series, click Advanced Options.

    For detailed information about these fields, see Selecting metrics.

  5. (Optional) The default view option for a chart is a line chart displayed in color mode. However, you can change both of these settings:

    • To change the chart mode, select the View options tab, and the select from the menu. The options available are dynamically set based on the chart's display-style. For more information on your choices, see View options.

    • To change the display-style for a chart, click Line to expand the pull-down menu. After you make a selection, that selection is listed adjacent to the pull-down menu. For examples of all chart types, see Chart types.

  6. (Optional) You can display multiple metrics on a single chart. If you want to display another metric, click Add Metric and repeat the previous two steps. A chart can display a maximum of 10 metrics.

  7. (Optional) Update the Chart title. By default, the chart title is generated by your metric selections. You can change the title of a chart after it is created by selecting Edit in the chart toolbar.

  8. Click Save.

You can put up to 25 charts on a dashboard.

Editing a chart

To edit the configuration of a chart, in the chart's toolbar, click Other options and select Edit.

For complete details on the chart toolbar, see Working with Charts.

Chart types

The chart type defines the chart's display style, such as line, stacked bar, or stacked area. The default chart type is a line chart.

To change the display style of a chart, in the chart toolbar, select Edit, and then select the desired type from the pull-down menu that is displaying the current chart style. The default style is line.

If you choose a chart type that is incompatible with a chosen chart mode, then the chart mode reverts to color mode. For example, if you have a line chart that is being viewed in X-ray mode and then select the chart type as stacked bar, the chart mode automatically switches to color mode. For information on the chart modes, see Setting view options.

This section provides graphical examples of different chart types. The first three screenshots show the same chart using three display styles. There are two types of line charts and one bar chart. The line charts are higher resolution than the bar chart; this is due to the alignment period used. The final chart is an example of a heatmap.

Standard line chart

The following screenshot is an example of a line chart in color mode. For these charts, a unique color is assigned to each time series.

Example of a line chart in color mode.

Line charts can be view in color mode, x-ray mode, stats mode, and in outlier mode.

Stacked area chart

The following screenshot is an example of a stacked area chart in color mode. For these charts, a unique color is assigned to each time series and the time series are stacked.

Example of a stacked area chart in color mode.

Stacked area charts can be viewed in color mode or outlier mode.

Stacked bar chart

The following screenshot is an example of a stacked bar chart in color mode. For these charts, a unique color is assigned to each time series and the time series are stacked.

Chart displaying stacked bars

Stacked bar charts can be viewed in color mode or outlier mode.

Heatmap

If you are viewing a distribution metric, then you can display the time series as a heatmap. The following image displays the request latencies for the Cloud Spanner API in one Google Cloud project:

Chart displaying a heatmap

Heatmaps can be viewed in color mode or outlier mode.

What's next