Dundas Chart for SharePoint Send comments on this topic.
Copying Splitting And Merging Data
See Also

Glossary Item Box

Overview

The manner in which data is handled depends largely on the architecture of the object, or objects, storing that data. Dundas Chart for SharePoint™ stores its data in a hierarchical framework that lets you lets access that data as needed, in an intuitive and logical manner. This article discusses the process of copying, splitting, aligning, and merging the web control's data.

Architecture

The architecture of Dundas Chart for SharePoint™ stores data in the following way:

Figure 1 below, illustrates the manner in which data is split. The Series object, contains Data Points, which in turn contain the X value, and multiple Y values.

 

Figure 1: Splitting data points.

 

Some chart types use multiple Y values (e.g. Stock, Bubble, Range chart, etc) while others only use the first Y value of data points (e.g. Line, Column, Pie chart, etc). To display dynamic charts where the chart type switches from a single Y value type to a multiple Y value type, then it must be possible to copy Y values. The CopySeriesValues method, of the DataManipulator class, does this using just one line of code. 

Data Alignment

To use the CopySeriesValues method with different series, all X values for each series must have aligned data.

 

Multiple series are considered to be aligned if:

  1. They have same number of data points.

  2. Corresponding data points (e.g. points which have the same index) have the same X values. 

 

Note
If Series are not aligned, then calling CopySeriesValues will result in an exception being thrown.

 

For more information on data alignment along with code samples, see the topic on Aligning Series.

Copying, Merging and Splitting Data

How the CopySeriesValues method is used determines if data is copied, split or merged. We have defined: "splitting" as copying multiple Y values from one source series to multiple destination series; "merging" as copying values from multiple source series to populate one destination series; and "copying" as all other copy operations.

 

Note
When using the CopySeriesValues method, the number of source values must match the number of destination values, otherwise an exception will be thrown.

 

Copying Data

Data is copied if data point values are moved from one series to another, and one or multiple Y values can be copied using one method call. The first source value will be copied to the first destination value, the second source value to the second destination value, and so on.

Here are two examples of copy operations: 

1. This example copies the first Y values of Series1's data points to the second Y values of Series2's data points. 

2. This example copies the first Y values from Series1 to the first Y values from Series2.

 

Merging Data

Data is considered to be "merged" when data point values are copied from multiple source series to one destination series. The first source value will be copied to the first destination value, the second source value to the second destination value, and so on.

 

Figure 3: Four line series with one Y-value each.

 

Figure 4: Stock chart resulting from a merge operation.

 

Splitting Data

Data is considered to have been "split" when data point values are copied from one source series to multiple destination series. The first source value will be copied to the first destination value, the second source value to the second destination value, and so on.

See Also