MaxLabelsWidth() Failing in v3.2.2722

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Aaron Peronto
Newbie
Newbie
Posts: 38
Joined: Thu Feb 01, 2007 12:00 am

MaxLabelsWidth() Failing in v3.2.2722

Post by Aaron Peronto » Mon Jun 25, 2007 2:50 pm

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

Aaron Peronto
Newbie
Newbie
Posts: 38
Joined: Thu Feb 01, 2007 12:00 am

Post by Aaron Peronto » Mon Jun 25, 2007 3:01 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jun 26, 2007 3:23 pm

Hi Aaron,

Thanks for reporting. This issue has just been fixed for the next v3 maintenance release.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Aaron Peronto
Newbie
Newbie
Posts: 38
Joined: Thu Feb 01, 2007 12:00 am

Post by Aaron Peronto » Tue Jun 26, 2007 4:29 pm

Excellent.
Glad to hear it will be fixed.
I'll keep an eye on the forums for the upcoming maint release.

Post Reply