Configure a chart widget
Create custom chart widgets and include them in your dashboards and reports.
Create a widget
To add a new widget to your dashboard or report:
-
In the top toolbar, click New widget and select Chart.
-
(Optional) Change the chart title.
The default chart title is based on the Y-axis series.
-
Configure the X and Y axes.
-
(Optional) To make each graph represents the mean of a run group, toggle Average grouped runs.
-
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:
- step, relative time, or absolute time
- one of the logged metrics
- custom expression
-
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:
- search for the logged metrics and check the ones to display,
- use a regular expression,
- build a custom expression.
-
In Axis control, set the axis range and choose between linear and logarithmic scale.
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:
-
In a dashboard or report, add a new chart widget or edit an existing one.
-
In Y-axis → Series, select at least two metrics or custom expressions.
You can combine metrics with custom expressions.
-
Configure other options as needed and save your changes.
You can plot a maximum of 1000 graphs on a single chart. For example, if you're displaying 20 metrics from each run, you can select a maximum of 50 runs to compare.
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.
- 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:
-
Go to Y-axis → Series → Dynamic selection.
-
In the input box, type a regular expression and click Apply.
You can apply one regular expression per chart. See also Syntax reference.
Create multiple charts at once
To create a separate chart for every selected metric:
-
In a dashboard or report, add a new chart widget or edit an existing one.
-
In Y-axis → Series, select at least two metrics.
-
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:
-
In a dashboard or report, create or edit a chart widget.
-
In Series, select Use custom expression.
-
Name your expression.
-
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}
-
-
Save your changes. The expression is applied automatically.
Supported operators
For detailed descriptions of the supported functions, see ClickHouse SQL Reference.
See all supported functions
-
Operators
Operator Syntax Example Addition +
${metric1} + ${metric2}
Subtraction -
${metric1} - ${metric2}
Multiplication *
${metric1} * ${metric2}
Division /
${metric1} / ${metric2}
Completion of metric calculation completion()
completion(${metric})
Maximum max()
max(${metric1}, ${metric2}, 0.5)
Minimum min()
max(${metric1}, ${metric2}, 0.5)
The arguments of the
max()
andmin()
functions can be attribute names, values, or expressions. -
Arithmetic functions
Function Description 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
Function Description 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
Function Returned value rand()
A random UInt32 number with uniform distribution. rand64()
A random UInt64 integer (UInt64) number. randCanonical()
A random Float64 number.
Example expressions
(${accuracy} - ${loss}) * some_value
exp(${accuracy} / 0.4)
log(${accuracy}) * 2
min(0.5, ${accuracy}, max(0.3, ${accuracy}-0.2))
Display point previews
By default, only data points that are non-previews are displayed on charts.
To display incomplete points, you must log metric previews. Note that Neptune considers all metric previews as incomplete, regardless of their completion level.
Charts that contain incomplete points have a special icon in the toolbar.
To view all points on a chart:
- Open the widget menu ().
- Select Display point previews.
Display completion level
In dashboards and reports, you can configure chart widgets to display the completion level of the metric computation:
-
Add a new chart widget or edit an existing one.
-
In Y-axis, apply the following custom expression:
completion(${AttributeName})
where
AttributeName
represents the metric whose computation level you want to display.
Edit a widget
-
To change the attributes displayed on the chart, go to Edit chart data.
-
To change the chart settings, open the widget menu ().
A blue dot on the widget menu indicates that custom settings already apply to the chart.
-
To rename the chart, double click its title or open the widget menu () → Rename widget.
-
To resize the widget, click and drag its bottom right corner.
Download or export a widget
To download the chart, go to the widget menu () → Download. You have the following options:
- download chart as a CSV table
- download chart as a PNG image
- copy chart to clipboard
To export the chart, go to the widget menu () → Duplicate into. You have the following options:
- duplicate the widget in the dashboard or report you're currently working on
- export the widget to a new or existing dashboard or report