id
Unique identifier for the series. Two series having the same id
are considered to be the same series, regardless of where they are located.
In general, you'll want different id
s per series so that every series is unique. However, when the same series has the same origin and is repeated across charts, keeping the id
consistent between different charts can help with some cross-chart functionality (like highlighting multiple charts simultaneously).
name
Defines the name of the series. This is often used in legends, tooltips, etc. to indicate which series you’re looking at. When fetching data from NRQL, this often refers to the facet name, like hostnames, countries, etc.
color
The color that represents the series. Most visualizations use this value to differentiate series; some visualizations, like the BillboardChart
or the JsonChart
, ignore it.
Colors are usually passed in hex format (i.e. #RRGGBB
), although any valid CSS color representation is allowed, like hsl(HHH, SS%, LL%)
or rgba(RR, GG, BB, .AA)
. We discourage tweaking the alpha value because it’s a feature often used by charts to highlight or dim certain series, so changing that might cause confusion.
The standard charting palette used by New Relic One has been crafted to look best in monitors and provide contrast between values.
viz
Describes how the series will be represented. The field accepts many different values, although the one you will use the most is main
:
main
: The given series will be charted based on the chart component where it is being passed. For instance, this series will be charted as a line in a LineChart
, but as an area in an AreaChart
.
line
: The series will be charted as a line, regardless of the chart where it is being passed. This setting only applies to AreaChart
s and ScatterChart
s; in other charts the series will not be shown.
area
: The series will be charted as an area, regardless of the chart where it’s being passed. This setting only applies to LineChart
s and ScatterChart
s; in other charts the series will not be shown.
event
: The series will be charted as an event, which is represented as a vertical area behind the main visualization. Events are often used to show alerts. This setting only applies to AreaChart
s, LineChart
s and ScatterChart
s; in other charts the series will not be shown. A vertical marker is also created using an event, in which its start and end values are the same. Vertical markers are often used to show deployment markers.
target-line
: The series is charted as a vertical line. This setting only applies to AreaChart
s, LineChart
s and ScatterChart
s; in other charts the series will not be shown.
units
Each value passed in each data point can have a unit assigned to it. Based on that unit, charts will pick the best possible way to represent them. Units are provided as a static string, with different values:
UNKNOWN
: the unit of the field is unknown, and will be left as-is when showing it in the UI.
COUNT
: the provided value is a count, without any particular unit associated to it. Values are then formatted with their International System prefix (k for thousands, M for millions, G for billions, etc).
PERCENTAGE
: the provided value is a ratio, usually ranging from 0 to 1. A value of 1 is formatted as 100%, a value of 2 is formatted as 200%, and a value of 0.01 is formatted as 1%.
MILLISECONDS
: the provided value is a duration, in milliseconds. If the given value is higher than 1, time is incrementally formatted as human-readable (e.g. 60,000 milliseconds are shown as 1 minute). If the given value is lower than 1, it is formatted following the SI prefixes (e.g. 0.001 milliseconds are shown as 1 μs).
TIMESTAMP
: the provided value is a timestamp, in milliseconds, counted from the UNIX Epoch. It will be formatted as a date, providing the amount of detail needed to be correctly interpreted.
BITS
: formats the value as bits, using the b
unit. When upscaling, the decimal prefixes are used, instead of the binary ones. This means that 1,000 bits are 1 kb, and formatted as such.
BYTES
: same as BITS
, except that the value is formatted as bytes, using B
as a unit. 1,000 bytes are represented as 1 kB.
Data
The series data is an Array
, containing data points represented as Object
s: