Change labels on x-axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Lizabeth
Newbie
Newbie
Posts: 24
Joined: Thu Nov 13, 2003 5:00 am
Location: Sweden

Change labels on x-axis

Post by Lizabeth » Thu Mar 25, 2004 2:57 pm

I have added a lot of data to a Points series through the Series.Add(double x, double y, string text, System.Drawing.Color color) method.

The labels and values on the x-axis then turns out to be the strings added. I do not want this! I want the labels and values on the x-axis to be the x-values added. How do I change the labels and values to be the x-values added instead of the strings?

I want the string values to be hidden. When clicking on a point in the series I want to be able to find out what the string value is for that particular point.

I also want to do the opposite - when I have a known string, I want to loop through all points to find out which one has the known string value and then set the color of that particular point.

How do I accomplish this?

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 Mar 25, 2004 4:12 pm

Hi --
The labels and values on the x-axis then turns out to be the strings added. I do not want this! I want the labels and values on the x-axis to be the x-values added. How do I change the labels and values to be the x-values added instead of the strings?
You can try the ENum AxisLabelStyle, e.g.

Code: Select all

tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
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/

Lizabeth
Newbie
Newbie
Posts: 24
Joined: Thu Nov 13, 2003 5:00 am
Location: Sweden

Retrieving data

Post by Lizabeth » Tue Mar 30, 2004 9:09 am

Hi,

Thank you! I also wanted to know the following:

When clicking on a point in the series I want to be able to find out what the string value is for that particular point. What property or method do I use to accomplish this?

I also want to do the opposite - when I have a known string, I want to loop through all points to find out which one has the known string value and then set the color of that particular point.

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 » Tue Mar 30, 2004 1:19 pm

Hi
Thank you! I also wanted to know the following:

When clicking on a point in the series I want to be able to find out what the string value is for that particular point. What property or method do I use to accomplish this?

I also want to do the opposite - when I have a known string, I want to loop through all points to find out which one has the known string value and then set the color of that particular point.
Try:

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e) {
			Random rnd = new Random();
			char chr;

			for(int i=0; i<10;++i){
				chr = Convert.ToChar(65 + i);
				points1.Add((double)i, rnd.Next(100), chr.ToString(), Color.Red);
			}
			points1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None;
			tChart1.Legend.Visible = false;
		}

		private void points1_Click(object sender, System.Windows.Forms.MouseEventArgs e) {
			int valueIndex = points1.Clicked(e.X, e.Y);
			double xVal, yVal;
			if(valueIndex!=-1) {
				label1.Text = points1[valueIndex].Label;
				//points1[valueIndex].Color = Color.Blue <- This does not work due to a bug
				//I have fixed this bug and this fix will be included in the next maintenance 
				//release. In the meantime you can do:
				xVal = points1[valueIndex].X;
				yVal = points1[valueIndex].Y;
				points1.Delete(valueIndex);
				points1.Add(xVal, yVal, label1.Text,Color.Blue);
			}
		}
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/

Lizabeth
Newbie
Newbie
Posts: 24
Joined: Thu Nov 13, 2003 5:00 am
Location: Sweden

Next maintenance

Post by Lizabeth » Wed Apr 07, 2004 8:07 am

Hi,

When does the next maintenance release come?

Regards

Post Reply