New Chart Components - 8.0.3 RC2
Timeseries charts, where the X-axis of the chart represents the passage of time, are of crucial importance in industrial applications like the kind built in Perspective. The 8.0.3 RC2 release brings with it two new timeseries chart components; the Time Series Component, and the Chart Range Selector Component. Each of these components are built with simplicity in mind. From the minimal configuration needed to get data displaying in the charts to the simplified style configuration, these components are easy to get functional and customized. These charts are of the sort where the data is represented in the chartâs properties. By default, the charts contain example data, but typically a tag history or named query binding will be used to feed data to the charts.
The Time Series Component is the main display component in this pair. It contains the following features (a full list of features and configuration is documented below):
- Zoom in/out via mouse wheel interaction.
- X-Trace display showing data at the hovered time position.
- Multiple chart display types (Area, Bar, Line, and Scatter).
- Multiple Y axes with the ability to align to the left or right side of the chart.
- Multiple plots as well as multiple trends per plot.
- Baselines and markers.
- Custom axes.
- Time range showing the overall range of the data being displayed in the chart
- Simple display customization for the axes, different trend display types, baselines, and markers.
The Chart Range Selector Component is meant to complement the Time Series Component. As such, it has a smaller feature list:
- Zoom in/out via mouse wheel interaction.
- Click-and-drag brush range selection and panning.
- âStartâ and âEndâ property values that are updated as the brush range changes. These properties can govern the start/end points of data queries to return a
DataSet
. - Time range showing the overall range of the data being displayed by the brush (range updates as the brush is updated).
- Simple display customization for the axes, baselines, markers, and the main chart data display.
These components are most powerful when paired together. When a query against the series data of the Time Series Component is made using the âstartâ and âendâ values of the brush from the Chart Range Selector, a display like this is possible:
Chart Range Selector driving a Time Series Component
Time Series Component
This component provides a performant way to visualize data from a variety of different data sources as chart data. You can get up and running with this component in a minimal way by providing a name
and data
entry (see the series.data
property for data formats) for the first series
item in the component properties. This will create a data display in the chart and auto-generate the axis by using the series name
and min/max values from the series data
.
To create a richer data display, you can build up a full plot
entry (or multiple entries). This allows for the creation of trends
, custom axes
, and different markers
that can be applied to the plot
. The best part about trends
? Different display types. In this first release, youâll have the ability to visualize your data as a Line, Area, Bar, or Scatter chart. âŚor as a mix of those. The following is a description of the configuration used by this component:
-
series (
Array
, required) - A list of series entries used as the base data source for the chart display. At a minimum, the Time Series component requires at least one complete series entry to display data. With no other configuration provided, an initial display will be created from the series data. Each series entry requires the following properties:-
name (
String
, required) - The name of the series. -
data (
Array | Object | DataSet
, required) - Data can be anObject
containing atime
entry and value entries (all must beNumbers
). Each value entry must be labeled with the column name to which it corresponds. Data can also be anArray
containing value entries (all must beNumbers
). Each value entry consists of a timestamp (which must be the first value) and one or more values that were captured at that time. Finally, data can also be in the form of aDataSet
. As an example of theDataSet
format, the data property can be bound to a Tag History binding to display either realtime data, or historical data (via start and end dates). To allow the Chart Range Selector component to drive the display of this component, a historical Tag History binding can be made where the âStart Dateâ and âEnd Dateâ fields are references (respectively) to theselectedRange.start
andselectedRange.end
values of the Chart Range Selector component:
-
name (
âRealtimeâ Databinding Example
âHistoricalâ Databinding Example
-
plots (
Array
, required) - A list of plot entries for the chart, and at least one entry is required. Plot entries contain properties that allow much finer control over the way that the series data can be displayed. Each plot will be represented by its own row in the component. A plot contains the following properties:-
trends (
Array
, optional) - If specified, a trend will become the display mechanism for the plot in which it resides. It describes the way that the data should look, and provides different display types as opposed to theline
display type that is provided when building from series data. Multiple trends will be built on top of each other in the sameplot
. An axis will be generated for eachtrend
, unless they share a common axis (either custom created, or generated fromseries
data). A trend contains the following properties:-
type (
String
, required) - This describes the type of chart to create. Options arearea
,bar
,line
, andscatter
. -
series (
String
, required) - This will point the trend to a series that should be used as the data source. -
axis (
String
, optional) - If specified, the name of an axis that is described in theaxes
property of the plot to which this trend belongs. This axis will be used as the Y axis for the trend. -
visible (
Boolean
, optional) - If specified, this is the visible state of the trend. If not visible, the trend data will be hidden, but the time range of the trend will still be represented in the overall time range of the plot. -
breakLine (
Boolean
, optional and applicable to theline
trend type) - This property will be available when a trend of typeline
is being used. If true, the line will be broken on either side of bad/missing data values. If false, bad/missing data values are removed and the adjoining points are connected. -
stack (
Boolean
, optional and applicable to thearea
andbar
trend types) - This property will be available when a trend of typearea
orbar
is being used. If true, the multiple columns of the chart will stack on top of each other. -
radius (
Number
, optional and applicable to thescatter
trend type) - This property will be available when a trend of typescatter
is being used. A number specifying the radius (in pixels) of the displaying points. -
columns (
Array
, optional) - If provided, only the columns in this list will be shown. Any style properties provided here will also override any existing style currently in place. A column contains the following properties:-
key (
String
, required) - This needs to match a column name from the series to which this trend is bound. Once in place, this will allow the style configuration provided here to override the styles provided in thedefaultStyles
property. -
color (
String
, optional) - If provided, this value will override any previous color values for the column (both stroke and fill). -
styles (
Object
, optional) - If provided, the styles for the state values listed here will override any previous state values. The state value options are:-
normal (
Object
, optional) - Takes the same configuration options as the same named state value under thedefaultStyles
property. -
highlighted (
Object
, optional) - Takes the same configuration options as the same named state value under thedefaultStyles
property. -
selected (
Object
, optional) - Takes the same configuration options as the same named state value under thedefaultStyles
property. -
muted (
Object
, optional) - Takes the same configuration options as the same named state value under thedefaultStyles
property.
-
normal (
-
key (
-
baselines (
Array
, optional) - If specified, a line will be drawn on the trend based upon a given type of functionality. The options for a baseline are:-
function (
String
, required) - The type of baseline that will be drawn. Options aremin
,max
,avg
,ucl
(upper control limit), andlcl
(lower control limit). -
column (
String
, optional) - The column against which the baseline should be calculated. If not specified, the first column in the series to which the trend is bound will be used. -
axis (
String
, optional) - The axis against which the baseline should be calculated. The trend must be bound to an axis for this to work correctly. -
visible (
Boolean
, optional) - The visible state of the baseline. -
color (
String
, optional) - The color of the line. -
width (
Number
, optional) - The width of the line. -
opacity (
Number
, optional) - The opacity of the line. -
dashArray (
Number
, optional) - The dashed appearance of the line. -
label (
Object
, optional) - The config used for the label drawn on the baseline.-
text (
String
, optional) - The label text. -
position (
String
, optional) - The position of the label relative to the baseline. -
font (
Object
, optional) - The config used for the font style of the label.-
color (
String
, optional) - The color of the label text. -
size (
Number
, optional) - The font size, in pixels, of the label text.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the baseline label. Any style that applies to an SVGtext
element can be used.
-
text (
-
style (
Object
, optional) - Custom CSS styles to apply to the line portion of the baseline. Any style that applies to an SVGline
element can be used.
-
function (
-
type (
-
axes (
Array
, optional) - A list of axis entries for that can be used for the plot. These can be used to override the Y Axis that is generated based on data in the series to which each trend is bound. An axis entry has the following properties:-
name (
String
, required) - The name of the axis. Also used as the display label of the axis. -
min (
Number
, required) - The minimum value of the axis. -
max (
Number
, required) - The maximum value of the axis. -
alignment (
String
, required) - The side of the trend upon which the axis should be presented. -
width (
Number
, required) - The pixel width of the axis. -
label (
Object
, optional) - The config used for the label drawn on the Y Axis.-
visible (
Boolean
, optional) - The visible state of the label. -
text (
String
, optional) - The label text. -
offset (
Nuymber
, optional) - Offset the Y axis label from its default position. This allows you to fine tune the label location, which may be necessary depending on the scale and how much room the tick labels take up. This may be positive or negative. -
font (
Object
, optional) - The config used for the font style of the label.-
color (
String
, optional) - The color of the label text. -
size (
Number
, optional) - The font size, in pixels, of the label text.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the Y axis label. Any style that applies to an SVGtext
element can be used.
-
visible (
-
tick (
Object
, optional) - The config used for the ticks drawn on the axis.-
color (
String
, optional) - The color of the ticks. -
label (
Object
, optional) - The config used for the label drawn on the tick.-
font (
Object
, optional) - The config used for the font style of the label.-
color (
String
, optional) - The color of the label text. -
size (
Number
, optional) - The font size, in pixels, of the label text.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the tick labels. Any style that applies to an SVGtext
element can be used.
-
font (
-
style (
Object
, optional) - Custom CSS styles to apply to the ticks. Any style that applies to an SVGline
element can be used.
-
color (
-
name (
-
markers (
Array
, optional) - A list of visual indicators that can be added to the plot. These are meant to draw emphasis to the data. In this first release, theline
marker will be the only available option. A marker entry has the following properties:-
visible (
Boolean
, optional) - The visible state of the marker. -
value (
Number
, required) - The numeric value that the marker represents. -
type (
String
, required) - The type of marker to be used. Currently, the only option isline
. -
axis (
String
, required) - The axis against which the marker should be drawn. -
line (
Object
, required) - The configuration for the line portion of the marker.-
width (
Number
, required) - The width of the line. -
color (
String
, optional) - The color of the line. -
opacity (
Number
, optional) - The opacity of the line. -
dashArray (
Number
, optional) - The dashed appearance of the line. -
label (
Object
, optional) - The configuration for the label portion of the marker.-
text (
String
, optional) - The text of the label for the marker. -
position (
String
, optional) - The position of the label relative to the line. -
font (
Object
, optional) - The config used for the font style of the label.-
color (
String
, optional) - The color of the label text. -
size (
Number
, optional) - The font size, in pixels, of the label text.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the marker label. Any style that applies to an SVGtext
element can be used.
-
text (
-
style (
Object
, optional) - Custom CSS styles to apply to the marker line. Any style that applies to an SVGline
element can be used.
-
width (
-
visible (
-
trends (
-
title (
Object
, required) - An object describing the title of the component. The following properties are available for the title:-
visible (
Boolean
, optional) - The visible state of the the title. -
text (
String
, optional) - The visual title of the chart. -
height (
Number
, optional) - The vertical space taken up by the title. -
font (
Object
, optional) - The config used for the style of the title.-
color (
String
, optional) - The color of the title text. -
size (
Number
, optional) - The font size, in pixels, of the title text.
-
color (
-
style (
Object
, optional) - A style object that is used to add visual style to the title. Style that can be applied to an SVGtext
element can be used here.
-
visible (
-
timeAxis (
Object
, required) - This property provides settings for the X Axis. Note that multiple plots share the same axis. The following properties are available fortimeAxis
:-
visible (
Boolean
, optional) - The visible state of the the axis. -
tickCount (
Number
, optional) - The number of ticks on the axis (as a multiple of 2, 5, or 10). -
height (
Number
, optional) - The height of the axis. -
color (
String
, optional) - The color of the axis. -
tick (
Object
, optional) - The config used for the ticks drawn on the axis.-
color (
String
, optional) - The color of the ticks. -
label (
Object
, optional) - The config used for the label drawn on the tick.-
angled (
Boolean
, optional) - If set to true, the tick labels will be angled rather than horizontal. -
font (
Object
, optional) - The config used for the font style of the label.-
color (
String
, optional) - The color of the label text. -
size (
Number
, optional) - The font size, in pixels, of the label text.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the tick labels. Any style that applies to an SVGtext
element can be used.
-
angled (
-
style (
Object
, optional) - Custom CSS styles to apply to the ticks. Any style that applies to an SVGline
element can be used.
-
color (
-
style (
Object
, optional) - A style object containing properties which are applied to the horizontal line of the axis. Any property that would apply to an SVGline
element can be used here.
-
visible (
-
timeRange (
Object
, optional) - An object describing the presentation of the time range display below the chart. The following properties are available: -
xTrace (
Object
, optional) - An object describing the presentation of the X Trace display. This display is shown when a chart is being hovered over with the mouse. Note that multiple plots will share the same X Trace display. The following properties are available:-
visible (
Boolean
, optional) - The visible state of the X Trace display as a whole. -
infoBox (
Object
, optional) - An object describing the presentation of the the box portion if the X Trace display. The following properties are available:-
visible (
Boolean
, optional) - The visible state of the info box. -
showTime (
Boolean
, optional) - If set to true, the timestamp of the current X Trace value will be shown above the info box. -
width (
Number
, optional) - The width of the info box. -
dataFormat (
String
, optional) - A NumeralJS value used to format the data found at the current timestamp of the X Trace display. See numeral.js for a list of available data formats. -
stroke (
Object
, optional) - A configuration object describing the properties that will be applied to the stroke of the box display. The following properties are available:-
color (
String
, optional) - The color of the box stroke. -
width (
Number
, optional) - The width of the box stroke. -
opacity (
Number
, optional) - The opacity of the box stroke. -
dashArray (
Number
, optional) - The dashed appearance of the box stroke.
-
color (
-
fill (
Object
, optional) - A configuration object describing the properties that will be applied to the fill of the box display. The following properties are available:-
color (
String
, optional) - The color of the box fill. -
opacity (
Number
, optional) - The opacity of the box fill.
-
color (
-
style (
Object
, optional) - A style object containing properties which are applied to the info box. Any property that would apply to an SVGrect
element can be used here.
-
visible (
-
line (
Object
, optional) - An object describing the presentation of the the line portion if the X Trace display. The following properties are available:-
visible (
Boolean
, optional) - The visible state of the X trace line. -
color (
String
, optional) - The color of the X trace line. -
width (
Number
, optional) - The width of the X trace line. -
opacity (
Number
, optional) - The opacity of the X trace line. -
dashArray (
Number
, optional) - The dashed appearance of the X trace line. -
style (
Object
, optional) - A style object containing properties which are applied to the line part of the xtrace display. Any property that would apply to an SVGline
element can be used here.
-
visible (
-
visible (
-
defaultStyles (
Object
, optional) - An object providing default style to the chart trends as a whole. The following properties are available:-
colorScheme (
String
, optional) - A Color Brewer color scheme to use on the series. See ColorBrewer2.org for available color schemes. -
colors (
Array
, optional) - A list of colors to apply to the columns (in order) for each trend. If these values are provided, they will override the value provided for thecolorScheme
. -
normal (
Object
, optional) - An object providing style configuration for the ânormalâ state (no user interaction) of a column, or data entry, in a trend. Any color values specified here will override values set in thecolorScheme
orcolors
properties. The following properties are available:-
stroke (
Object
, optional) - A configuration object describing the properties that will be applied to the stroke of the trend type being displayed (if applicable).line
, andarea
trend types will have these styles applied to them. The following properties are available:-
color (
String
, optional) - The color of the trend stroke. -
width (
Number
, optional) - The width of the trend stroke. -
opacity (
Number
, optional) - The opacity of the trend stroke. -
dashArray (
Number
, optional) - The dashed appearance of the trend stroke.
-
color (
-
fill (
Object
, optional) - A configuration object describing the properties that will be applied to the fill of the trend type being displayed (if applicable).area
, andbox
, andscatter
trend types will have these styles applied to them. The following properties are available:-
color (
String
, optional) - The color of the trend fill. -
opacity (
Number
, optional) - The opacity of the trend fill.
-
color (
-
stroke (
-
highlighted (
Object
, optional) - An object providing style configuration for the âhighlightedâ state (mouse hover) of a column, or data entry, in a trend. Any color values specified here will override values set in thecolorScheme
orcolors
properties. Thehighlighted
property uses the same configuration properties as thenormal
property. -
selected (
Object
, optional) - An object providing style configuration for the âselectedâ state (mouse click) of a column, or data entry, in a trend. Any color values specified here will override values set in thecolorScheme
orcolors
properties. Theselected
property uses the same configuration properties as thenormal
property. -
muted (
Object
, optional) - An object providing style configuration for the âmutedâ state (non selected) of a column, or data entry, in a trend. Any color values specified here will override values set in thecolorScheme
orcolors
properties. Themuted
property uses the same configuration properties as thenormal
property.
-
colorScheme (
Chart Range Selector Component
When this component is configured, start
and end
sub properties of the selectedRange
property can be used as the respective start/end points in a historical Tag History binding providing data to the series
property of the Time Series component. As you interact with the time brush on this chart, those start
and end
properties will be updated with the millisecond timestamp that corresponds to their values. With that in place, you have a Chart Range Selector Component driving the display of a Time Series Component. The following is a description of the configuration used by this component:
-
data (
Array | Object | DataSet
, required) - This property uses the same configuration as theseries.data
property of the Time Series Component. -
selectedRange (
Object
, required) - This property is updated as you interact with the brush. These are the values that can drive the display of other components. The following properties are available:-
start (
Number
, required) - The millisecond timestamp representing the value of the head of the brush. -
end (
Number
, required) - The millisecond timestamp representing the value of the tail of the brush.
-
start (
-
brushRange (
Object
, optional) - An object used to control the display of the date/time range values at the bottom of the component. The following properties are available: -
timeAxis (
Object
, required) - This property uses the same configuration as thetimeAxis
property of the Time Series Component. -
yAxis (
Object
, optional) - An object used to control the display of the Y Axis. This component was built with the assumption that this axis may be secondary information, so it can be deemphasized, if desired. The following properties are available:-
visible (
Boolean
, optional) - The visible state of the axis. -
width (
Number
, required) - The pixel width of the axis. -
label (
Object
, optional) - The config used for the label drawn on the Y Axis.-
visible (
Boolean
, optional) - The visible state of the label. -
text (
String
, optional) - The label text. -
offset (
Nuymber
, optional) - Offset the Y axis label from its default position. This allows you to fine tune the label location, which may be necessary depending on the scale and how much room the tick labels take up. This may be positive or negative. -
font (
Object
, optional) - The config used for the font style of the label.-
color (
String
, optional) - The color of the label text. -
size (
Number
, optional) - The font size, in pixels, of the label text.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the Y axis label. Any style that applies to an SVGtext
element can be used.
-
visible (
-
tick (
Object
, optional) - The config used for the ticks drawn on the axis.-
color (
String
, optional) - The color of the ticks. -
label (
Object
, optional) - The config used for the label drawn on the tick.-
font (
Object
, optional) - The config used for the font style of the label.-
color (
String
, optional) - The color of the label text. -
size (
Number
, optional) - The font size, in pixels, of the label text.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the tick labels. Any style that applies to an SVGtext
element can be used.
-
font (
-
style (
Object
, optional) - Custom CSS styles to apply to the ticks. Any style that applies to an SVGline
element can be used.
-
color (
-
style (
Object
, optional) - Custom CSS styles to apply to the axis. Any style that applies to an SVGline
element can be used.
-
visible (
-
areaStyles (
Object
, optional) - An object providing default style to the chart trends as a whole. This property uses the same configuration as thedefaultStyles
property of the Time Series Component.