Spread Silverlight Documentation
GrapeCity.Windows.SpreadSheet.Data Namespace / LegendAlignment Enumeration
Example Example


In This Topic
    LegendAlignment Enumeration
    In This Topic
    Specifies how to align the legend.
    Syntax
    'Declaration
     
    Public Enum LegendAlignment 
       Inherits System.Enum
    'Usage
     
    Dim instance As LegendAlignment
    public enum LegendAlignment : System.Enum 
    Members
    MemberDescription
    BottomCenterAlign the legend at the bottom center of the chart.
    BottomLeftAlign the legend at the bottom left of the chart.
    BottomRightAlign the legend at the bottom right of the chart.
    MiddleLeftAlign the legend at the middle left of the chart.
    MiddleRightAlign the legend at the middle right of the chart.
    TopCenterAlign the legend at the top center of the chart.
    TopLeftAlign the legend at the top left of the chart.
    TopRightAlign the legend at the top right of the chart.
    Example
    This example sets the LegendAlignment enumeration.
    GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries series0 = new GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries();
    series0.Name = "Series 0";
    series0.Values.Add(1.0);
    series0.Values.Add(2.0);
    series0.Values.Add(4.0);
    series0.Values.Add(8.0);
    
    GrapeCity.Windows.SpreadSheet.Data.ChartTitle label = new GrapeCity.Windows.SpreadSheet.Data.ChartTitle();
    label.Text = "Pie Point Chart";
    label.FontSize = 10;
    label.FontFamily = new FontFamily("Tahoma");
    GrapeCity.Windows.SpreadSheet.Data.Legend l = new GrapeCity.Windows.SpreadSheet.Data.Legend();
    l.Alignment = GrapeCity.Windows.SpreadSheet.Data.LegendAlignment.TopLeft;
    
    GrapeCity.Windows.SpreadSheet.Data.SpreadChart chart = new GrapeCity.Windows.SpreadSheet.Data.SpreadChart();
    chart.ChartTitle = label;
    chart.Legend = l;
    chart.DataSeries.Add(series0);
    // chart.DataSeries.Add(series1);
    chart.ChartType = GrapeCity.Windows.SpreadSheet.Data.SpreadChartType.Pie;
    chart.Name = "name1";
    this.gcSpreadSheet1.ActiveSheet.Charts.Add(chart);
    Dim series0 As New GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries()
    series0.Name = "Series 0"
    series0.Values.Add(1.0)
    series0.Values.Add(2.0)
    series0.Values.Add(4.0)
    series0.Values.Add(8.0)
    
    Dim label As New GrapeCity.Windows.SpreadSheet.Data.ChartTitle()
    label.Text = "Pie Point Chart"
    label.FontSize = 10
    label.FontFamily = New FontFamily("Tahoma")
    Dim l As New GrapeCity.Windows.SpreadSheet.Data.Legend()
    l.Alignment = GrapeCity.Windows.SpreadSheet.Data.LegendAlignment.TopLeft
    
    Dim chart As New GrapeCity.Windows.SpreadSheet.Data.SpreadChart()
    chart.ChartTitle = label
    chart.Legend = l
    chart.DataSeries.Add(series0)
    ' chart.DataSeries.Add(series1)
    chart.ChartType = GrapeCity.Windows.SpreadSheet.Data.SpreadChartType.Pie
    chart.Name = "name1"
    GcSpreadSheet1.ActiveSheet.Charts.Add(chart)
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             GrapeCity.Windows.SpreadSheet.Data.LegendAlignment

    See Also