Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.Core.v4.4 Assembly / Xceed.Chart.Core Namespace / Legend Class / Data Property
Example


In This Topic
    Data Property (Legend)
    In This Topic
    The legend data when the legend operates in Custom mode.
    Syntax
    'Declaration
     
    <CategoryAttribute("Content")>
    <DescriptionAttribute("The legend data when the legend operates in Custom mode")>
    Public Property Data As LegendData
    'Usage
     
    Dim instance As Legend
    Dim value As LegendData
     
    instance.Data = value
     
    value = instance.Data
    [Category("Content")]
    [Description("The legend data when the legend operates in Custom mode")]
    public LegendData Data {get; set;}
    Remarks
    When you set the legend in custom mode you can manually feed data to the legend by accessing the Array property of the LegendData object.
    Example
    The following code changes the legend mode and adds a custom legend item.
    legend.Mode = LegendMode.Manual
    
    Dim item As LegendDataItem =  New LegendDataItem() 
    item.Text = "Custom legend item"
    item.MarkFillEffect.SetGradient(GradientStyle.Horizontal, GradientVariant.Variant1, Color.Azure, Color.Blue)
    item.MarkShape = LegendMarkShape.Rectangle
    legend.Data.Array.Add(item)
    legend.Mode = LegendMode.Manual;
    
    LegendDataItem item = new LegendDataItem();
    item.Text = "Custom legend item";
    item.MarkFillEffect.SetGradient(GradientStyle.Horizontal, GradientVariant.Variant1, Color.Azure, Color.Blue);
    item.MarkShape = LegendMarkShape.Rectangle;
    legend.Data.Array.Add(item);
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also