Adding custom label doesn't initialize properly

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
davidh
Newbie
Newbie
Posts: 2
Joined: Wed May 24, 2006 12:00 am

Adding custom label doesn't initialize properly

Post by davidh » Thu Oct 05, 2006 4:36 am

When you do the following,

AxisLabelItem myLabel = new AxisLabelItem();
myLabel.Color = (blah, blah, blah ....)
...
Chart.Axes.Bottom.Labels.Items.Add(myLabel);

you get an exception on the paint event.
The internal iAxisLabelsItems is not being set during this type of Add.

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

Post by Narcís » Thu Oct 05, 2006 10:51 am

Hi davidh,

Thanks for reporting,

We have fixed this issue and we expect to have a new maintenance release ready before the end of this week. You should use something like this:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      line1.FillSampleValues();

      tChart1.Axes.Bottom.Labels.Items.Clear();
      AxisLabelItem myLabel = new AxisLabelItem(tChart1.Chart);
      myLabel.Transparent = false;
      myLabel.Color = Color.Red;
      myLabel.Value = 10;
      tChart1.Axes.Bottom.Labels.Items.Add(myLabel);
    }
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

Post Reply