Version

Working with Scatter Chart Data

This topic discusses useful information that will help you to ensure that your data is rendered properly in the scatter chart.

Data Requirements

While the Chart control allows you to easily point the chart to your own custom data, it is important that you are supplying the appropriate amount and type of data that the chart requires. If the data does not meet the minimum requirements based on the type of chart that you are using, an error will be generated.

The following is a list of data requirements for scatter charts:

Note
Note

If the data available is in a format where each row represents the x and y values, and each column contains points for each series, then you should swap the rows and columns. For information on how to do this, see Swap Rows and Columns.

Mapping Data to Scatter Charts

The chart data is rendered using the following rules:

  • The first two numeric columns specified as ColumnX and ColumnY are used in the order in which they appear.

  • You can select alternate columns (or rows) for ColumnX and ColumnY.

  • Both the X-axis (horizontal axis) and Y-axis (vertical axis) are numeric in Scatter charts, so that the data is plotted on a two-dimensional plane. Labels on both axes can be formatted using the FormatString property and a “numeric format”:

UltraChart.Axis.X.Labels.ItemFormatString = "<DATA_VALUE:##.##>"
UltraChart.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:##.##>"
  • If the ConnectWithLines property is set to True, then line segments connect the points identified by subsequent rows.

  • Each row represents one scatter point.

  • The columns at the indices specified by the ColumnX and ColumnY properties will be used to determine the horizontal (X) position, and vertical (Y) position of each scatter point.

  • Scatter points can be grouped according to the value in a specific column by specifying the GroupByColumn property, and setting the UseGroupByColumn property to True. Different icons/colors will be used for scatter points in different groups. If the ConnectWithLines property is set to True, lines will connect only scatter points within the same group.

  • The first string column encountered in the data will be used for row labels.

  • You can select an alternate column to be used for row labels, and toggle between the primary and secondary labels.

  • You can include or exclude any column from the chart using the UltraChart.Data. IncludeColumn method.

See below for an example data set, along with the rendered scatter chart.

Latitude Longitude Crime Rate

0

0

2.36

120

25

6.69

-25

100

3.65

-80

-100

5.36

63

-12

8.56

156

75

5.36

-129

166

7.29

-175

-86

1.23

96

-177

4.69

36

111

2.354

-75

69

5.58

-99

-50

4.36

29

-143

6.24

Shows a Scatter Chart based on the data listed in the table above.