ColorMember works ALMOST for all points in a serie

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

ColorMember works ALMOST for all points in a serie

Post by Simon » Tue Feb 10, 2004 8:02 pm

Hi
I'm using ColorMember method with ASP.NET.

Almost all the points (28 on 32) receive the correct color property specifie in a DataTable. But the series show 4 points with random Color.

When I look into my dataSet at execution I see "Color [Blue]" but it show a Yellow, Gray and Green points.

I'm using the last buid package (1.1.1499.42325).

Do you have any clue for me ? thanks

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Feb 11, 2004 5:47 pm

Hi Simon,
Almost all the points (28 on 32) receive the correct color property specifie in a DataTable. But the series show 4 points with random Color.
Would you be so kind as to send me an example code snippet so that I can reproduce the problem here?

Many thanks,
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

my ScreenShoot

Post by Simon » Fri Feb 13, 2004 2:44 pm

Hi,
I think this screenShoot can explain easilly my problem :

Image

the ScreenShoot show 4 points with the wrong color. I can be sure the ColorMember is correct by the Mark directly bind from the Color Colums. Here a sample of my code, (really basic)

Code: Select all

		private bool initialiseSerie()
		{
			Steema.TeeChart.Styles.Bubble styleBubble = new Steema.TeeChart.Styles.Bubble(webChart.Chart);
			
			//Creation des Evenements associés a la série
			styleBubble.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(bubbleSeries1_GetPointerStyle);
			styleBubble.GetSeriesMark +=   new Steema.TeeChart.Styles.CustomPoint.GetSeriesMarkEventHandler(bubbleSeries1_GetSeriesMark);
			
			//Création de l'axe des X
			styleBubble.DataSource = mTable; 
			styleBubble.XValues.DataMember = mTable.Columns["Jour_rabotage"].ToString();
			styleBubble.XValues.DateTime = true;
			
			//Création de l'Axe des Y
			styleBubble.YValues.DataMember = mTable.Columns[ddlAxeY.SelectedItem.Text].ToString();  
			
			//Spécification de la taille des bulles
			styleBubble.RadiusValues.DataMember = mTable.Columns["Radius"].ToString();

			//Spécification de la couleur des bulles
			styleBubble.ColorMember = mTable.Columns["Couleur"].ToString();
			
			//Spécification de la propriétés de MARK.
			styleBubble.Marks.Visible = true;
			styleBubble.Marks.Color = Color.Beige;
			styleBubble.Marks.Transparent = false;

			styleBubble.Marks.ArrowLength = 20;
			styleBubble.Marks.Arrow.Color = Color.Black;
			styleBubble.Marks.Bevel.Width= 7;
			styleBubble.Marks.Brush.Color = Color.Beige;
			styleBubble.Marks.ShapeStyle = Steema.TeeChart.Drawing.TextShapeStyle.RoundRectangle;

		
			//MAJ des propriétées quelconques de la série
			styleBubble.ShowInLegend = false;
			
			webChart.Chart.Series.Add(styleBubble);
						
            return true;
		}

I bind the ColorMember with a columns (dataType System.Drawing.Color)
styleBubble.ColorMember = mTable.Columns["Couleur"].ToString();

I have really no idea what to do with this problem. If the picture is cannot be see, you can give me an e-mail adress and I will send it.

thanks lot.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Feb 16, 2004 12:21 pm

Hi --
I bind the ColorMember with a columns (dataType System.Drawing.Color)
Mmm .. how are you doing this? When I do this:

Code: Select all

DataColumn colColor = new DataColumn("colColor",Type.GetType("System.Drawing.Color", true));
I get a runtime exception.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

humm, not exactly

Post by Simon » Tue Feb 17, 2004 8:06 pm

Hi Christopher,
You're right, I use a Object dataype. Here the code where I create the color's column. I fill this colums with Color object System.Drawing.Color.

Code: Select all

DataColumn myColumn = new DataColumn(); 
			myColumn.DataType = System.Type.GetType("System.Object"); 
			myColumn.AllowDBNull = false; 
			myColumn.Caption = "Couleur"; 
			myColumn.ColumnName = "Couleur"; 
			myColumn.DefaultValue = Color.Black;
			mTable.Columns.Add(myColumn);
later, I bind the colorMember with this colums :

Code: Select all

//Spécification de la couleur des bulles
			styleBubble.ColorMember = mTable.Columns["Couleur"].ToString();
As I send in my previous e-mail (ScreenShoot), I also show the value of the columns "Couleur" in the mark property.

I have absolutly no idea what I'm doing wrong but I still try to control the color of each point in a serie. Do you have any clues ?

thanks lot

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Feb 18, 2004 8:48 am

Hi --
I have absolutly no idea what I'm doing wrong but I still try to control the color of each point in a serie. Do you have any clues ?
Mmm ... the following code works fine here:

Code: Select all

tChart1.Aspect.View3D = false;
Random r=new Random(10);

DataTable myTable = new DataTable("myTable");
DataColumn colXVal = new DataColumn("XVal",Type.GetType("System.DateTime"));
DataColumn colData = new DataColumn("Data",Type.GetType("System.Int32"));
DataColumn colRad = new DataColumn("Rad",Type.GetType("System.Int32"));
DataColumn colCol = new DataColumn("Color",Type.GetType("System.Object"));

myTable.Columns.Add(colXVal);
myTable.Columns.Add(colData);
myTable.Columns.Add(colRad);
myTable.Columns.Add(colCol);

DateTime today = DateTime.Today;
DataRow NewRow;
for(int i = 0; i <50; i++) {
	NewRow = myTable.NewRow();
	NewRow["XVal"] = today;
	NewRow["Rad"] = r.Next(5);
	NewRow["Data"] = r.Next(10);
	NewRow["Color"] = Color.Aqua;
	today=today.AddDays(1);
	myTable.Rows.Add(NewRow);
}

tChart1.Series[0].XValues.DateTime = true;
bubble1.RadiusValues.DataMember=colRad.ToString();
tChart1.Series[0].XValues.DataMember=colXVal.ToString();
tChart1.Series[0].YValues.DataMember=colData.ToString();
tChart1.Series[0].ColorMember=colCol.ToString();
tChart1.Series[0].DataSource=myTable;
Does this code work OK at your end? If so, you might be inadvertantly changing something in the PointerStyleEvent.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

I create a small exemple for U

Post by Simon » Wed Feb 18, 2004 7:23 pm

Hi Christopher,
I try your exemple and it work fine with my system to.

I have modify your exemple and I use the operator % (modulo).

Every columns in my exemple is suppose to have the same color.

Image

I invite you to try my script to be sure the problem is not comming from my system

Code: Select all

Color[] tab_couleur = { Color.Red, Color.Orange, Color.Yellow, Color.LightGreen, Color.Green};
	
			Steema.TeeChart.Chart tChart1 = webChart.Chart;
			Steema.TeeChart.Styles.Bubble bubble1 = new Steema.TeeChart.Styles.Bubble(tChart1);
			tChart1.Aspect.View3D = false; 

			DataTable myTable = new DataTable("myTable"); 
			DataColumn colXVal = new DataColumn("XVal",Type.GetType("System.Int32")); 
			DataColumn colData = new DataColumn("Data",Type.GetType("System.Int32")); 
			DataColumn colRad = new DataColumn("Rad",Type.GetType("System.Int32")); 
			DataColumn colCol = new DataColumn("Color",Type.GetType("System.Object")); 

			myTable.Columns.Add(colXVal); 
			myTable.Columns.Add(colData); 
			myTable.Columns.Add(colRad); 
			myTable.Columns.Add(colCol); 

			DataRow NewRow; 
			for(int i = 0; i <50; i++) 
			{ 
				NewRow = myTable.NewRow(); 
				NewRow["XVal"] = i%5;
				NewRow["Rad"] = 2; 
				NewRow["Data"] = i;
				NewRow["Color"] = tab_couleur[i%5];
				myTable.Rows.Add(NewRow); 
			} 

			bubble1.RadiusValues.DataMember=colRad.ToString(); 
			tChart1.Series[0].XValues.DataMember=colXVal.ToString(); 
			tChart1.Series[0].YValues.DataMember=colData.ToString(); 
			tChart1.Series[0].ColorMember=colCol.ToString(); 
			tChart1.Series[0].DataSource=myTable;  
as I wrote in my first mail, I'm using asp.net with the last buid package (1.1.1499.42325).

Many thanks,

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Thu Feb 19, 2004 10:33 am

Hi --

Because you are using the % operator you will have to set:
tChart1.Series[0].XValues.Order = ValueListOrder.None;
Which corrects the problem.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

ok

Post by Simon » Thu Feb 19, 2004 7:11 pm

well, it looks good. Thanks

Post Reply