Chart for .NET / User's Guide / Legend / Header and Footer

In This Topic
    Header and Footer
    In This Topic

    The legend header and footer are represented by the NLegendHeader and NLegendFooter objects respectively, accessible through the Header and Footer properties of the NLegend object.

    Both objects inherit from the NLegendTitle class and share the same properties. In order to change the text style of the legend header or footer you must modify the NTextStyle object controlling the header or footer text appearance. The Text property specifies the displayed text. The following code shows how to assign some text to legend header:

    C#
    Copy Code
    NLegendHeader legendHeader = legend.Header;
    legendHeader.Text = "Some legend header";
    legendHeader.TextStyle.FontStyle = new NFontStyle("Arial", 12);
    legendHeader.Inflate = new NSizeL(new NLength(6, NGraphicsUnit.Pixel), new NLength(6, NGraphicsUnit.Pixel));
    
    Visual Basic
    Copy Code
    Dim legendHeader As NLegendHeader = legend.Header
    
    legendHeader.Text = "Some legend header"
    legendHeader.TextStyle.FontStyle = New NFontStyle("Arial", 12)
    legendHeader.Inflate = New NSizeL(New NLength(6, NGraphicsUnit.Pixel), New NLength(6, NGraphicsUnit.Pixel))
    

    The Inflate property of the NLegendTitle allows you to additionally increase the header or footer size. By default the header and footer texts are blank and the legend does display them.

    See Also