This example illustrates the use of the DevExpress.Spreadsheet.Workbook instance to perform the calculations on data bound to an external data source. The calculation result is located in the cell exposed as the data source for the DevExpress.XtraGauges.Win.GaugeControl control.
The source data are pairs of System.Diagnostics.PerformanceCounter object values. Performance samples (TwoCounterSample objects) are collected at the time interval specified by the timer. The samples are stored in the collection. A WorksheetProcessor
object instance is created to process the collection of samples. A WorksheetProcessor
includes a Workbook instance with a Worksheet sheet containing a table bound to the performance data collection. The TableCollection.Add method is used to create a table bound to data.
The CORREL statistical function calculates the correlation coefficient. The cell containing the calculation result is exposed as the data source using the CellRange.GetDataSource method.
The worksheet data source providing a correlation coefficient value is bound to the Gauges.Circular.ArcScaleComponent.DataBindings and LabelComponent.DataBindings collections of the circular gauge control. The gauge control shows the correlation dynamically.
- Form1.cs (VB: Form1.vb)
- PerformanceDataProvider.cs (VB: PerformanceDataProvider.vb)
- TwoCounterSample.cs (VB: TwoCounterSample.vb)
- WorksheetProcessor.cs (VB: WorksheetProcessor.vb)
(you will be redirected to DevExpress.com to submit your response)