Glossary Item Box
The Chart control allows you to bind a formula to the ValueMembersY property of a series to create a calculated or sequence series for your chart.
You can easily create a calculated series based on the values of one or more series by setting the ValueMembersY property of a series to a formula. To reference a series in the formula, use the name of the series. The following code demonstrates creating two series, one bound to a data array and the other bound to a formula based on the Y values of the first series.
' Visual Basic Dim s As New DataDynamics.ActiveReports.Chart.Series Dim cS As New DataDynamics.ActiveReports.Chart.Series Dim a As Double() = {1, 4, 2, 6, 3, 3, 4, 7} Me.ChartControl1.Series.AddRange(New DataDynamics.ActiveReports.Chart.Series() {s, cS}) Me.ChartControl1.Series(0).Points.DataBindY(a) Me.ChartControl1.Series(0).Name = "Series1" Me.ChartControl1.Series(1).ValueMembersY = "Series1.Y[0]+10"
// C# DataDynamics.ActiveReports.Chart.Series s = new DataDynamics.ActiveReports.Chart.Series(); DataDynamics.ActiveReports.Chart.Series cS = new DataDynamics.ActiveReports.Chart.Series(); double [] a = { 1,4,2,6,3,3,4,7}; this.ChartControl1.Series.AddRange(new DataDynamics.SharpGraph.Windows.Series[] {s, cS}); this.ChartControl1.Series[0].Name = "Series1"; this.ChartControl1.Series[0].Points.DataBindY(a); this.ChartControl1.Series[1].ValueMembersY = "Series1.Y[0]+10";
Set a sequence series by specifying the minimum value, maximum value, and step for the series. The following code shows how to set the ValueMembersY property at run time to create a sequence series.
' Visual Basic Dim s As New DataDynamics.ActiveReports.Chart.Series Me.ChartControl1.Series.Add(s) Me.ChartControl1.Series(0).ValueMembersY = "sequence(12,48,4)"
// C# DataDynamics.ActiveReports.Chart.Series s = new DataDynamics.ActiveReports.Chart.Series(); this.ChartControl1.Series.Add(s); this.ChartControl1.Series[0].ValueMembersY = "sequence(12,48,4)";
Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.