Page 1 of 1
Change labels on x-axis
Posted: Thu Mar 25, 2004 2:57 pm
by 8122778
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?
Posted: Thu Mar 25, 2004 4:12 pm
by Chris
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;
Retrieving data
Posted: Tue Mar 30, 2004 9:09 am
by 8122778
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.
Posted: Tue Mar 30, 2004 1:19 pm
by Chris
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);
}
}
Next maintenance
Posted: Wed Apr 07, 2004 8:07 am
by 8122778
Hi,
When does the next maintenance release come?
Regards