Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This wpf control was developed in order to present a bar chart with line.

Presentation

The BarAndSplineCustomChart control is a custom chart designed to display historical values for a given tag in column format and with row that touches the history values on the chart.

How to use

Minimum requirements

  • Action.Net version 9.2.28.1 or later;

Configuration

  1. Insert the file "SPIN. ActionNet.View.Wpf.Charts.dll" in the WpfControls folder of the installation (typically under "C:\Program Files (x86)\SPIN\Action.Net\an-x.x\WpfControls\") if it does not exist.

  2. Open the project of Action.Net where the control will be used;

  3. In the "Draw" tab, choose the page where the control will be used;

  4. In the toolsidebar, choose the item "Insert Component";

  5. When you open the component selection screen, select the BarAndSplineCustomChart control;

  6. Insert the control into the screen and scale it.

  7. Select the control and insert a Uid into it. This is what will be used in the code-behind to pass the data to the chart.

  8. Set up the code in the screen code-behind:

Initially, you must access the control from your Uid. To take a reference from the control to use it, use the following script:

Then the data needs to be passed to the control. It has a function for passing data from a datatable to the control. Your subscription can be found below:

Where:

tagName: refers to the search tag. This parameter is used for the Header of the chart.

histValues: refers to a table whose format consists of the first column with values compatible with the type DateTime and the second column with values compatible with the types float or Double.

This function can be called as shown below:

Attention: It is extremely important that the table follows the expected format with two columns, namely:

  • First column with values compatible with type DateTime; and

  • Second column with values compatible with types float or Double.

Tables that do not support this format can have unexpected consequences for the chart.

This sample-specific application used the Spin toolkit to search for measures for a given period (last 10 days). The full code for this application can be checked below:

On this page:

  • No labels