Page 1 of 1

Adding custom label doesn't initialize properly

Posted: Thu Oct 05, 2006 4:36 am
by 9791383
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.

Posted: Thu Oct 05, 2006 10:51 am
by narcis
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);
    }