1

The legend currently auto-sizes according to the max width of the labels it contains, which is throwing my layout. I need to set a width or min-width. Here is my legend creation method:

public Legend CreateLegend()
{
   var legend = new Legend();
   legend.Enabled = true;
   legend.Font = new Font("Arial", 11F);
   legend.ForeColor = Color.FromArgb(102, 102, 102);

   return legend;
}

It seems like anything I do which accesses the Position object for the legend (defines X an Y coords, width and height) makes the legend disappear completely.

So legend.Position.Width = 5 would make it disappear...

GP24
  • 867
  • 2
  • 13
  • 28

1 Answers1

0

Okay, turns out that if you do not define all four properties of the Position object, it sets them to zero...so height was zero...so it disappeared. Awesome.

GP24
  • 867
  • 2
  • 13
  • 28