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?
Change labels on x-axis
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi --
You can try the ENum AxisLabelStyle, e.g.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?
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/
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/
Retrieving data
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.
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.
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi
Try: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.
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/
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/
Next maintenance
Hi,
When does the next maintenance release come?
Regards
When does the next maintenance release come?
Regards