Skip to main content

Configure a chart widget

Create custom chart widgets and include them in your dashboards and reports.

A chart with a menu button, edit button, and smoothing slider highlighted.

Create a widget

To add a new widget to your dashboard or report:

  1. In the top toolbar, click New widget and select Chart.

  2. (Optional) Change the chart title.

    The default chart title is based on the Y-axis series.

  3. Configure the X and Y axes.

  4. (Optional) To make each graph represents the mean of a run group, toggle Average grouped runs.

  5. Save your changes.

Configure the X axis

You can specify the following X-axis options in your chart:

  • In Series, define the input values. You can choose from the following:

  • In Axis control, set the axis range and choose between linear and logarithmic scale.

Configure the Y axis

You can specify the following Y-axis options in your chart:

  • In Series, select the metrics to display on the chart. The following options are available:

  • In Axis control, set the axis range and choose between linear and logarithmic scale.

Info

Neptune Scale distributes axis points evenly, even when the scaling is non-linear.

Compare multiple metrics on one chart

To display several metrics on one chart widget:

  1. In a dashboard or report, add a new chart widget or edit an existing one.

  2. In Y-axisSeries, select at least two metrics or custom expressions.

    You can combine metrics with custom expressions.

  3. Configure other options as needed and save your changes.

Create multiple charts at once

To create a separate chart for every selected metric:

  1. In a dashboard or report, add a new chart widget or edit an existing one.

  2. In Y-axisSeries, select at least two metrics.

  3. In Single or multi-chart, select Create a chart for each Y-axis.

Once you save your changes, multiple widgets are created, one for every selected metric.

Custom Y or X expressions

In dashboards and reports, you can build mathematical expressions of logged metadata. A single expression can consist of several attribute names and operations.

Using expressions lets you calculate and display derivative metrics after the data is logged. For example, a weighted average of five separate metrics.

Create a custom expression

To create a custom expression:

  1. In a dashboard or report, create or edit a chart widget.

  2. In Series, select Use custom expression.

  3. Name your expression.

  4. In the input box, type ${ and select an attribute from the drop-down menu. To complete the expression:

    • Use at least one supported operator

    • (Optional) Add more attributes, using the following syntax for each attribute:

      ${AttributeName}
  5. Save your changes. The expression is applied automatically.

When hovering over the resulting graph, the legend shows the name of the expression in the Metric column.

Supported operators

For detailed descriptions of the supported functions, see ClickHouse SQL Reference.

See all supported functions
  • Operators

    OperatorSyntaxExample
    Addition+${metric1} + ${metric2}
    Subtraction-${metric1} - ${metric2}
    Multiplication*${metric1} * ${metric2}
    Division/${metric1} / ${metric2}
  • Arithmitic functions

    FunctionDescription
    negate()Negates the value of an argument.
    abs()Calculates the absolute value of an argument.
  • Mathematical functions

    • e()
    • pi()
    • exp()
    • exp2()
    • exp10()
    • intExp2()
    • intExp10()
    • log()
    • log2()
    • log10()
    • lgamma()
    • tgamma()
    • cbrt()
    • sqrt()
    • sin()
    • sinh()
    • cos()
    • cosh()
    • tan()
    • tanh()
    • asin()
    • asinh()
    • acos()
    • acosh()
    • atan()
    • atanh()
    • erf()
    • erfc()
    • sign()
    • sigmoid()
    • degrees()
    • radians()
    • factorial()
  • Rounding functions

    FunctionDescription
    floor()Returns the largest rounded number less than or equal to an argument.
    ceil()Like floor() but returns the smallest rounded number greater than or equal to an argument.
    trunc()Like floor() but returns the rounded number with largest absolute value that has an absolute value less than or equal to the arguments.
    round()Rounds a value to a specified number of decimal places.
    roundToExp2()Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to the nearest (whole non-negative) degree of two.
    roundDuration()Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to numbers from the set of commonly used durations.
  • Functions for generating random numbers

    FunctionReturned value
    rand()A random UInt32 number with uniform distribution.
    rand64()A random UInt64 integer (UInt64) number.
    randCanonical()A random Float64 number.

Example expressions

(${metric1} - ${metric2}) * some_value
exp(${metric1} / 0.4)
log(${metrics/acc}) * 2

Select metrics dynamically

Use regular expressions to select all metrics that match the pattern and dynamically display them on a chart. When you log more metrics that match the pattern, the chart gets updated automatically to include them.

note
  • When you log new metrics that match an already applied regular expression, refresh the page to see them displayed on the chart.
  • Dynamic selection isn't available in auto-generated dashboards.

To dynamically display metrics on the chart:

  1. In a dashboard or report, create or edit a chart widget.

  2. Go to Y-axisSeriesDynamic selection.

  3. In the input box, type a regular expression and click Apply.

    You can apply one regular expression per chart. See also Syntax reference.

Export a widget

When your chart is ready, you can download it as a CSV table or a PNG image. You can also export a chart widget to a new or existing dashboard or report.

To access the export options, open the widget menu ().