Items in Chart Views
- 3 minutes to read
For the ExpressQuantumGrid the term “item” is used to describe a column in a data store. In a Chart View, items stand for the columns that correspond to series, data groups, and the default categories. When series values are grouped at a data level associated with the visible data group, the unique values of this data group determine the categories which series values are arranged into. Otherwise, the values of the default categories are used to categorize series values.
Each record in a data store corresponds to a category value and at least one series value.
The arrangement options of the items differ from diagram to diagram since each one provides options for visually representing category values and series values which are specific to the type of diagram. The only thing you need to address to change the manner in which the items are displayed within a Chart View is to activate another diagram (by setting its Active property to True).
As with items in tabular and Card Views, series, data groups, and the default categories can be divided into two groups: data-aware and non data-aware. Data-aware items (TcxGridDBChartSeries, TcxGridDBChartDataGroup, and TcxGridDBChartCategories) are used in the corresponding data-aware View (TcxGridDBChartView). Non data-aware items (TcxGridChartSeries, TcxGridChartDataGroup, and TcxGridChartCategories) are elements of the non data-aware View (TcxGridChartView).
A Chart View has the Series, DataGroups, and Categories properties which maintain the collections of items (series, data groups, and the default categories, respectively) created within the View. To access the series and data groups which are currently visible within a Chart View, use the View’s VisibleSeries and VisibleDataGroups properties.
The Component Editor allows you to access all the series and data groups in a Chart View and create/delete them at design time. You can use the CreateSeries and CreateDataGroup methods to manually create series and data groups at runtime.
It’s possible to get and set the value of an item using either the Values collection of the default categories or the Values collection of a series and data group. Alternatively, you can use the View’s ViewData.Categories, ViewData.Values, and ViewData.GroupValues indexed collections, which address the same values. To access values of the items which are currently displayed, use the View’s ViewData.VisibleCategories, ViewData.VisibleValues, and ViewData.VisibleGroupValues, respectively.
To add a series value, call the AddValue method of the corresponding series.
Every item has a DataBinding property which links items to the data in a View’s data controller which retrieves data from and posts it back to a data store. Data-aware items redefine DataBinding to work with TDataSet fields.
To sort data by an item, you should use its SortOrder property.
Note
The sorting applied to the series takes priority over the sorting by the default categories or a data group. Only a single type of sorting (either by the default categories/data group or series values) is active at a time within the chart. The series whose values are sorted can be accessed via the View’s SortedSeries property. End-users are able to customize the sorting applied to the series using the Customization Form.