Gant Chart-Color Member Problem

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
bora
Newbie
Newbie
Posts: 5
Joined: Wed Jan 25, 2006 12:00 am

Gant Chart-Color Member Problem

Post by bora » Thu Feb 02, 2006 3:32 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 06, 2006 1:00 pm

Hi Bora,

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
Image Image Image Image Image Image
Instructions - How to post in this forum

bora
Newbie
Newbie
Posts: 5
Joined: Wed Jan 25, 2006 12:00 am

Post by bora » Mon Feb 06, 2006 1:29 pm

Hi,

I'd set the NextTask's DataMember before. As i wrote my application was working in evaluation version. I installed Licensed Version and this problem occured. I didn't make any code change. I think problem is different. But what?

Thanks.

Bora

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 06, 2006 3:13 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply