Obtaining Underlying and Displayed Data
- 5 minutes to read
The DashboardViewer control provides the API that allows you to obtain underlying data from the dashboard data source and client data displayed within the dashboard item.
Each data-bound dashboard item aggregates underlying data based on the provided dimensions. Measure/delta values are calculated at the intersection of these dimensions. Thus, dashboard items visualize dimension values and corresponding measure/delta values. You can access a hierarchical representation of this data using the DashboardViewer API.
Client Data Structure
The MultiDimensionalData object is used to hold hierarchical data displayed within the dashboard item in a unified way. The dimension value corresponding to a specific hierarchy level is stored in the AxisPoint class, that defines a point in a multidimensional space. Such points are placed on a specific data axis represented by the DataAxis class. For instance, the pivot grid has the "Row" and "Column" axes, the chart has the "Argument" and "Series" axes, etc. The DashboardDataAxisNames class provides access to names that allow you to identify various types of data axes.
The image below illustrates how hierarchical data is stored in the MultiDimensionalData object.
The MultiDimensionalData object allows you to obtain settings of dimensions/measures that provide the displayed data. These settings include data member identifiers, formatting options, data item name, etc.
The MultiDimensionalData.GetDimensions method returns the dimensions that provide data for the specified axis. To obtain measures, use the MultiDimensionalData.GetMeasures method. You can also obtain information about deltas using the MultiDimensionalData.GetDeltas method (for the Grid, Card, Gauge and Choropleth Map dashboard items).
To access dimension values, you need to obtain axis points placed on the required data axis. Use the MultiDimensionalData.GetAxisPoints method to obtain axis points placed on the specified data axis. The MultiDimensionalData.GetAxisPointsByDimension method allows you to obtain only axis points corresponding to the specified dimension.
As an alternative, obtain the required data axis by calling the MultiDimensionalData.GetAxis method. The returned DataAxis object exposes the DataAxis.GetPoints method that returns axis points belonging to the current axis.
You can obtain dimension values for these axis points using the following members.
The MultiDimensionalData.GetSlice method returns the slice of the current MultiDimensionalData object by the specified axis point. For instance, the slice of multidimensional data by the axis point corresponding to "Product 3" allows you to obtain summary values for all date intervals (horizontal shaded area). The slice by the axis point corresponding to "May" contains summary values for all products (vertical shaded area). So, you need to sequentially call this method two times to obtain the slice at the intersection of the "Product 3" and "May" axis points.
To obtain total summary values or summary values at the intersection of several axis points, call the MultiDimensionalData.GetValue method and pass the required measure obtained using the MultiDimensionalData.GetMeasures method. To obtain delta values, use the MultiDimensionalData.GetDeltaValue method and pass the required delta obtained using the MultiDimensionalData.GetDeltas method.
You can obtain measure values for the returned MeasureValue objects using the following members.
The DeltaValue object contains multiple options that allow you to obtain actual/target values and various delta settings.
The DashboardViewer also provides the events that allow you to obtain client data related to the clicked visual element.
To learn more, see Events.
The dashboard visualizes aggregated data from the underlying data source.
You can obtain underlying data for particular dashboard item using the DashboardViewer.GetUnderlyingData method. This method's overloads allow you to obtain underlying data related to the specified axis point.
The DashboardViewer also provides the events that allow you to obtain underlying data related to the clicked visual element. For instance, the grid in the image below displays underlying data related to the clicked pivot grid' cell.
To learn more, see Events.
The DashboardViewer allows you to access underlying and client data when handling the following events.
When handling these events, you can obtain the axis point related to the clicked visual element (the DashboardItemMouseHitTestEventArgs.GetAxisPoint method) or corresponding underlying data (the DashboardItemMouseHitTestEventArgs.GetUnderlyingData method). Use the DashboardItemMouseEventArgs.DashboardItemName event parameter to obtain the component name of the dashboard item, for which the event was raised.