ArcObjects Library Reference  (CartoUI)    

DataGraphT CoClass

A container for the display and manipulation of graph series.

Product Availability

Available with ArcGIS Desktop.


Interfaces Description
IDataGraphBase (esriCarto) Provides access to members that control the data graph.
IDataGraphT Provides access to members that control data graph.
IPersistStream (esriSystem)
IWorkspaceEditEvents (esriGeoDatabase) Provides access to events that occur to a workspace in the context of editing it.

Event Interfaces

Interfaces Description
IDataGraphTEvents (default) Provides access to events that occur when graph object changes.


DataGraphT is the container for graph series, it can be cocreated. Each graph should contain at least one series. To make a series (which is a non-cocreatable object), AddSeries (IDataGraphT::AddSeries) should be used. There are two kinds of series, they are graph series and function series (it also implements IFunctionSeriesProperties). A series can be added (IDataGraphT::AddSeries), removed (IDataGraphT::RemoveSeries), or reordered (IDataGraphT::SeriesOrder). Graph series can be made from feature layer, raster layer, or standalone table. Function series can only be made from existing graph series. Graph can either be displayed on graph window (IDataGraphWindow2 from DataGraphWindow coclass), or be displayed on layout view. Graphs are saved either within map document (IDataGraphCollection), or as grf file.


DataGraphT implements three interfaces, they are IDatagraphT, IDataGraphBase, and IDataGraphTEvents . There are different properties setting in a graph. They include legend properties, axis properties, and general properties.


Graphs can be built based on selected set from the input data. There are two methods available: HighlightSelection (from IDataGraphT) and UseSelectedSet (from IDataGraphBase). If UseSelectedSet is set to true, graph series will be built based on selection. There are two modes on how graph is drawn. The first one is by highlighting features on the graph (HighlightSelection is set to true in this case), and the second one is building graph from selected features only (HighlighteSelection is set to false in this case).



[Visual Basic 6.0]


The following code let you create a vertical bar graph with one series inside:


Dim pCancelTracker As ITrackCancel
Set pCancelTracker = New CancelTracker
Dim pLayer As ILayer
Set pLayer = pMapDocument.Map(0).Layer(0)

Dim pDataGraphT As IDataGraphT
Set pDataGraphT = New DataGraphT
Dim pSP As ISeriesProperties
Set pSP = pDataGraphT.AddSeries("bar:vertical")
pSP.SourceData = pLayer
pSP.SetField 1, "XYZ"
pDataGraphT.Update pCancelTracker

Working with Events

[Visual Basic 6.0]

When working with DataGraphT's default outbound interface in Visual Basic 6 declare variables as follows:

Private WithEvents pDataGraphT as DataGraphT