Creating and managing charts

This page focuses on building and editing charts from the dashboard view. If you are interested in Metrics Explorer, an alternative tool for building a chart, see Using Metrics Explorer.

Charts can display any numeric metric type, including custom metrics and logs-based metrics. 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 the following tasks:

  • Determining what kind of information you want to view, and then how best to display that data:

    • If you want to view time series data over a time interval, then create a line chart, stacked area chart, stacked bar chart, or a heatmap. Stacked bar charts are recommended for metrics with infrequent samples, such as those quota metrics which have 1 sample per day. Heatmaps are recommended for distribution-type metrics. With these charts, you can view the entire distribution and overlay percentile lines.
    • If you want an indicator if the most recent value is in a danger zone, a warning zone, or within an expected range, then add a gauge or scorecard to your dashboard. You must use the Cloud Monitoring API to create a gauge or a scorecard; however, you can view them by using the Google Cloud Console. For information on using the Cloud Monitoring API to create a gauge or a scorecard, see Dashboard with a basic Scorecard.
    • If you want to add information about the dashboard or what to do in different situations, then add a text box. You must use the Cloud Monitoring API to create a text box; however, you can view it by using the Google Cloud Console. For information on using the Cloud Monitoring API to create a text box, see Dashboard with a Text widget.

    For examples of the different types of charts available, see Plot types.

  • Identifying the specific data to appear on the chart. For more information, see Selecting data to chart.

  • Optionally, you can configure the chart to show a threshold, show outliers, compare current data to past data, among other options.

You can put up to 25 charts on a dashboard.

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 information on the chart toolbar and how to configure the appearance of a chart, see Setting view options.

Deleting a chart

To delete a chart, click Other options in the chart toolbar and then select Delete.

Plot types

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

This section provides graphical examples of different plot 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 next chart is an example of a heatmap. The final three sections illustrate gauges, scorecards, and text boxes.

Changing the plot type

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 plot 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 plot type as stacked bar, the chart mode automatically switches to color mode. For information on the chart modes, see Setting view options.

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.

Example of a stacked bar chart in color mode.

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

Heatmap chart

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:

Example of a heatmap chart.

Heatmaps can be viewed in color mode or outlier mode.

Gauges

If you want to view the most recent measurement as compared to a color-coded set of thresholds, then create a gauge. For example, the gauge in the following screenshot has 3 regions: green, yellow, and red. The measured value is displayed numerically and on the gauge with solid line:

Example of a dashboard with a gauge.

To create a gauge, you must use the Cloud Monitoring API. You can view, but not modify, gauges by using the Google Cloud Console. For information on using the API, see Dashboard with a GaugeView.

Scorecards

If you want to view the most recent measurement as compared to a set of thresholds, then create a scorecard. For example, the following screenshot illustrates a scorecard configured to display as a SPARK_LINE:

Example of a dashboard with a scorecard.

In this image, the line is green, indicating the most recent measurement isn't in a warning or danger region.

To create a scorecard, you must use the Cloud Monitoring API. You can view, but not modify, scorecards by using the Google Cloud Console. For information on using the API, see Dashboard with a basic Scorecard.

Text boxes

If you want to add information about the dashboard or what to do in different situations, then create a text box. For example, the following screenshot illustrates a text box.

Example of a dashboard with a text widget.

To create a text box, you must use the Cloud Monitoring API. You can view, but not modify, text boxes by using the Google Cloud Console. For information on using the API, see Dashboard with a Text widget.

What's next