rockzZ25

Bar Chart in Dockable Window C#

Discussion created by rockzZ25 on Nov 15, 2010
Latest reply on Nov 15, 2010 by rockzZ25
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;

Outcomes