Bar Chart in Dockable Window C#

483
1
11-15-2010 05:33 AM
FaizanTayyab
Occasional Contributor
Hi,

I am trying to create a bar chart using datagraph. However when i assign the feature class table to the datagraph.table property it does nothing (even while debugging, the code stops at this point).

IFeatureClass openedFClass=wksFileFeature.OpenFeatureClass(datasetName);
int fieldIndex = openedFClass.FindField("Customers");
int fieldIndex2 = openedFClass.FindField("Name");

ITable table = (ITable)openedFClass;

MessageBox.Show(table.Fields.FieldCount.ToString());
IDataGraph datagraph;
IDataGraphProperties datagraphProperties;


IField pField1,pField2;
pField1 = table.Fields.get_Field(fieldIndex);
pField2 = table.Fields.get_Field(fieldIndex2);

datagraph = new DataGraphClass();

datagraph.Table = table; Problem on this line..Stops executing.
datagraph.FieldSet1 = pField1.Name;
datagraph.FieldSet1 = pField2.Name;
0 Kudos
1 Reply
FaizanTayyab
Occasional Contributor
Solved: Need to create a FeatureLayer from the featureClass and then use:

pDataGraph.Table=(ITable)fLayer;

However does anybody know how to add the genereated DataGraph to a dockable window with a reference

m_dockableWindow

Thanks
0 Kudos