Skip to end of metadata
Go to start of metadata

Component Palette Icon:



On this page ...

The Chart component (also called the Classic Chart when contrasted with the Easy Chart) provides a flexible way to display either timeseries or X-Y charts that are powered by any number of datasets. Typically, these datasets are bound to SQL Query Bindings in Vision.

Features

  • SQL Query and/or SQLTags Historian data sources
  • Zoom, Pan, X-Trace modes
  • Any number of Y-axes and subplots
  • Realtime or Historical
  • Many different rendering styles

Configuration 

The basic idea behind configuring the classic chart is simple: add datasets, and fill them in with data in a format that the chart understands. You add datasets to the chart using the chart's customizer. You then use standard property bindings to put data into these charts. Commonly you'll use a SQL Query Bindings in Vision. Since these datasets are just normal dynamic properties, you can also access them via scripting.  

The Customizer also lets you add additional X and Y axes. There are various types of axes, and they each have a large number of properties. You can configure additional properties for each dataset, such as which axes it maps to, its visual style, subplot, etc.

Datasets 

Each dataset should define one or more "series" (a.k.a "pens"). Each series in a dataset shares common X-values, defined by the first column. Each additional column are the Y-values for a series.

Chart Type: XY vs Category  

The classic chart is typically in XY Plot mode. This means that the X-axis is either date or numeric, and the Y-axes are numeric. If your X-axis is categorical (names, not numbers), you can switch the Chart Type property to Category Chart in the Property Editor. Don't be surprised when you get a few errors - you'll need to go and switch your X-axis to be a Category Axis, and fill your dataset in with valid category data, that is, String-based X-values. This is most often used with the Bar Renderer (see the Vision - Chart Customizer).


NameDescriptionProperty TypeScriptingCategory
Background ColorThe background color of the component. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.Color.backgroundAppearance
Border

The border surrounding this component. Options are: No border, Etched (Lowered), Etched (Raised), Bevel (Lowered), Bevel (Raised), Bevel (Double), Button Border, Field Border, Line Border, and Other Border.

Note: The border is unaffected by rotation.

Border.borderCommon
Chart OrientationThe orientation of the domain axis of the chart.int.orientationAppearance
Chart TitleAn optional title that will appear at the top of the chart.String.titleAppearance
Chart TypeChoose the type for this chart: XY (Numeric X-axis) or Category (String X-axis).int.chartTypeBehavior
CursorThe mouse cursor to use when hovering over this component. Options are: Default, Crosshair, Text, Wait, Hand, Move, SW Resize, or SE Resize.int.cursorCodeCommon
Extract OrderExtract order for how category datasets should be interpreted.int.extractOrderBehavior
FontFont of text on this component.Font.fontAppearance
Foreground ColorThe foreground color of the component.Color.foregroundAppearance
Mouseover TextThe text that is displayed in the tooltip which pops up on mouseover of this component.String.toolTipTextCommon
NameThe name of this component.String.nameCommon
Plot BackgroundThe background color for all plots, unless they override it.Color.plotBackgroundAppearance
Properties LoadingThe number of properties currently being loaded. (Read only. Usable in bindings and scripting.)int.propertiesLoadingUncategorized
QualityThe data quality code for any Tag bindings on this component.QualityCode.qualityData
Selected DatapointThe currently selected datapoint. (Read only. Usable in bindings and scripting.)String.selectedDataUncategorized
Selected X ValueThe selected domain axis value for X-Trace and Mark modes. (Read only. Usable in bindings and scripting.)String.selectedXValueUncategorized
Selection Enabled?If true, the user will be able to select datapoints on the chart. The selected datapoint will be highlighted, and the selectedData property will reflect it.boolean.selectionEnabledBehavior
Selection Highlight ColorThe color of the selection highlight.Color.selectionHighlightColorAppearance
Selection Highlight WidthThe line width of the selection highlight.float.selectionHighlightWidthAppearance
Show Legend?If true, a legend will be shown for the series displayed in the chart.boolean.legendAppearance
Show Popup?If true, a popup menu will be shown on right-click that allows the user to change mode, print, save, etc.boolean.showPopupBehavior
Show Tooltips?If true, tooltips showing point values will be displayed.boolean.tooltipsBehavior
Subplot ModeThe axis that subplots share if more than one subplot.int.subplotModeBehavior
VisibleIf disabled, the component will be hidden.boolean.visibleCommon
Deprecated Properties
Data QualityThe data quality code for any Tag bindings on this component.int.dataQualityDeprecated

Scripting

Component Functions

This component does not have component functions associated with it.

Extension Functions

 configureChart
  • Description

Provides an opportunity to perform further chart configuration via scripting.

  • Parameters

Component self- A reference to the component that is invoking this function.

JFreeChart chart- A JFreeChart object. Refer to the JFreeChart documentation for API details.

  • Return

Nothing


 getXTraceLabel
  • Description

Provides an opportunity to configure the x-trace label. Return a string to override the default label.

  • Parameters

Component self- A reference to the component that is invoking this function.

JFreeChart chart - A JFreeChart object. Refer to the JFreeChart documentation for API details.

String penName - The name of the pen the x-trace label applies to.

int yValue - The y-value of the pen at the x-trace location

  • Return

Nothing


Customizers

The Chart component uses its own customizer called the Vision - Chart Customizer. You add datasets and additional XY axes to a chart using the tabs in the chart customizer. You can configure additional properties for each dataset, like what axes it maps to as well as select from a host of visual styles. It also has six axis types to choose from, each with an extensive list of properties.

The customizer already has some default styles in place to help you get started, but you can modify these default settings to your own style. Refer to the Vision - Chart Customizer section for property descriptions and examples of chart axis types.


Examples

Example

  • No labels