Dundas Chart for Windows Forms
CopySeriesValues Method
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > DataManipulator Class : CopySeriesValues Method


inputSeries

The name(s) of the input series along with an optional Y-value (e.g. "Series1:Y3"). To specify multiple series use a comma-separated list. Y-values are separated from the series name using a colon, and if a Y-value is not specified the first Y-value will be used.

outputSeries

The name(s) of the output series along with an optional Y-value (e.g. "Series1:Y3"). To specify multiple series use a comma-separated list. Y-values are separated from the series name using a colon, and if a Y-value is not specified the first Y-value will be used. The number of output series must match the number of input series, otherwise an exception will be thrown .

Enterprise Edition Only Feature. Copies Y-values of one or more input series' data points to one or more output series' data points.

Syntax

Visual Basic (Declaration)  
Public Sub CopySeriesValues( _
   ByVal inputSeries As String, _
   ByVal outputSeries As String _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim inputSeries As String
Dim outputSeries As String
 
instance.CopySeriesValues(inputSeries, outputSeries)
C#  
public void CopySeriesValues( 
   string inputSeries,
   string outputSeries
)

Parameters

inputSeries

The name(s) of the input series along with an optional Y-value (e.g. "Series1:Y3"). To specify multiple series use a comma-separated list. Y-values are separated from the series name using a colon, and if a Y-value is not specified the first Y-value will be used.

outputSeries

The name(s) of the output series along with an optional Y-value (e.g. "Series1:Y3"). To specify multiple series use a comma-separated list. Y-values are separated from the series name using a colon, and if a Y-value is not specified the first Y-value will be used. The number of output series must match the number of input series, otherwise an exception will be thrown .

Example

The following sample code merges 4 series with one Y-value each into one series with 4 Y-values.

Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

    ' Copy the High, Low, Open and Close series values into a new series called "Stock" that has 4 Y values
    chart1.DataManipulator.CopySeriesValues("High:Y,Low:Y,Open:Y,Close:Y",
        "Stock:Y1,Stock:Y2,Stock:Y3,Stock:Y4")

    ' Set stock series attributes
    chart1.Series("Stock").Type = SeriesChartType.Stock
    chart1.Series("Stock").BorderWidth = 2
    chart1.Series("Stock").ShadowOffset = 1

    ' Remove the High, Low, Open and Close series so that only the Stock series is shown.
    chart1.Series.Remove(chart1.Series("High"))
    chart1.Series.Remove(chart1.Series("Low"))
    chart1.Series.Remove(chart1.Series("Open"))
    chart1.Series.Remove(chart1.Series("Close"))

...
C# Copy Code
using Dundas.Charting.WinControl
...

   
// Copy the High, Low, Open and Close series values into a new series called "Stock" that has 4 Y values
   
chart1.DataManipulator.CopySeriesValues("High:Y,Low:Y,Open:Y,Close:Y",
       
"Stock:Y1,Stock:Y2,Stock:Y3,Stock:Y4");

   
// Set stock series attributes
   
chart1.Series["Stock"].Type = SeriesChartType.Stock;
   chart1.Series
["Stock"].BorderWidth = 2;
   chart1.Series
["Stock"].ShadowOffset = 1;

   
// Remove the High, Low, Open and Close series so that only the Stock series is shown.
   
chart1.Series.Remove(chart1.Series["High"]);
   chart1.Series.Remove(chart1.Series[
"Low"]);
   chart1.Series.Remove(chart1.Series[
"Open"]);
   chart1.Series.Remove(chart1.Series[
"Close"]);
   
...

Remarks

Copies Y-values from one or more input series' data points to one or more output series' data points.

This method can be used to copy, split and merge series data points.

If multiple input values are specified (from either one series or different series) then there must be an equal number of specified output values (from either one series or different series) otherwise an exception will be thrown.

Important: all series must be aligned, otherwise an exception will be thrown. Series are aligned if they have the same number of data points, with corresponding data points having the same X-values. Refer to the Aligning Series topic for further details.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.