Page 1 of 1

MaxLabelsWidth() Failing in v3.2.2722

Posted: Mon Jun 25, 2007 2:50 pm
by 9794096
I just upgraded to v3 this morning and I am trying to run through our application to make sure that everything that worked in v2 for us now works the same in v3.

The first thing that I ran into is MaxLabelsWidth().
I am trying to ensure that the spacing of my axis label is correct depending on what the length of my largest label on my axis is.

The first time through my check of the MaxLabelsWidth() on my custom axis, it works fine and I see that it returns 15. Since this is less than my minimum distance of 30, I set CustomSize = 30.
The next time I come through (when I plot another series to this same chart) I am getting a Parameter Not Valid exception when I try to evaluate tchar.Axes.Custom[0].MaxLabelsWidth().
The axis is valid, the CustomSize still shows my 30 that I set previously but now this method will not properly execute.

Any idea what is going wrong with this?
This is the way I did this check in v2 and it worked just fine for me.

Any quick help you can give me on this problem would really be appreciate.

Thank.
Aaron

Posted: Mon Jun 25, 2007 3:01 pm
by 9794096
I just wrote a quick little test application that gives the same results using the Left axis of the chart.
Here is the code contained within my test app:

private Steema.TeeChart.Styles.Custom new1;

private void Form1_Load(object sender, EventArgs e)
{
new1 = new Steema.TeeChart.Styles.Custom(this.tChart1.Chart);
new1.Stairs = true;
new1.Color = Color.Black;
new1.LinePen.Visible = true;
new1.Pointer.Visible = true;
new1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
new1.FillSampleValues(30);
new1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
this.tChart1.Series.Add(new1);

}

private void button1_Click(object sender, EventArgs e)
{
tChart1.Axes.Left.Title.Text = "Left Axis";

if (tChart1.Axes.Left.MaxLabelsWidth() < 30)
{
tChart1.Axes.Left.Labels.CustomSize = 30;
}


}


All you have to do is drop a TeeChart and a button on your form and add this code.
The first click of the button sets the title and spacing properly.
The second click of the button gives a Parameter Not Valid Exception when trying to evaluate MaxLabelsWidth().

Thanks.

Posted: Tue Jun 26, 2007 3:23 pm
by narcis
Hi Aaron,

Thanks for reporting. This issue has just been fixed for the next v3 maintenance release.

Posted: Tue Jun 26, 2007 4:29 pm
by 9794096
Excellent.
Glad to hear it will be fixed.
I'll keep an eye on the forums for the upcoming maint release.