Hi,
I developed an application with Evaluation version of Pro2 for .Net... I used gant chart with a datatable as its datasource. Nothing was wrong with this application. But i when i purchased and set up the full version ColorMember attribute didn't work.
Is it a version problem? (I didn't changed the code)
Any idea?
Bora.
Gant Chart-Color Member Problem
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Bora,
The problem may be because it is necessary to populate the NextTasks value list as shown here:
The problem may be because it is necessary to populate the NextTasks value list as shown here:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
tChart1.Axes.Bottom.Labels.Style=AxisLabelStyle.Value;
CreateTable();
LoadData();
}
private void CreateTable()
{
Random r=new Random(255);
// Create DataTable
sourceTable = new DataTable("sourceTable");
colStart = new DataColumn("StartDates",Type.GetType("System.Double"));
colEnd = new DataColumn("EndDates",Type.GetType("System.Double"));
colYData = new DataColumn("YData",Type.GetType("System.Double"));
colTask = new DataColumn("NextTask",Type.GetType("System.Double"));
colDesc = new DataColumn("Desc",Type.GetType("System.String"));
colColor = new DataColumn("Color",Type.GetType("System.Object"));
sourceTable.Columns.Add(colStart);
sourceTable.Columns.Add(colEnd);
sourceTable.Columns.Add(colYData);
sourceTable.Columns.Add(colDesc);
sourceTable.Columns.Add(colColor);
sourceTable.Columns.Add(colTask);
// Add table items.
DataRow NewRow;
double lastVal=32000;
for(int i = 0; i <10; i++)
{
Color cc=Color.FromArgb(r.Next(255),r.Next(255),r.Next(255));
NewRow = sourceTable.NewRow();
NewRow["Desc"] = "Label"+i.ToString();
NewRow["StartDates"] = lastVal;
NewRow["EndDates"] = lastVal+10;
NewRow["YData"] = r.Next(10);
NewRow["Color"] = cc;
NewRow["NextTask"] = 0;
sourceTable.Rows.Add(NewRow);
lastVal=lastVal+5+r.Next(5);
}
}
private void LoadData()
{
tChart1[0].Clear();
gantt1.StartValues.DataMember = "StartDates";
gantt1.EndValues.DataMember = "EndDates";
gantt1.YValues.DataMember = "YData";
gantt1.NextTasks.DataMember = "NextTask";
gantt1.ColorMember = "Color";
gantt1.DataSource = sourceTable;
gantt1.CheckDataSource();
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Bora,
Could you please test if it works and if not let us know which error do you get and which TeeChart version are you using? As I mentioned before, the code above works for me here using latest TeeChart for .NET v2 release.
Could you please test if it works and if not let us know which error do you get and which TeeChart version are you using? As I mentioned before, the code above works for me here using latest TeeChart for .NET v2 release.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |