Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.Server.v4.4 Assembly / Xceed.Chart.Server Namespace / ChartServerControl Class / Charts Property
Example


In This Topic
    Charts Property (ChartServerControl)
    In This Topic
    Retrieves the charts collection of the component
    Syntax
    'Declaration
     
    <CategoryAttribute("Xceed Chart for ASP.NET")>
    <DescriptionAttribute("Retrieves the charts collection of the component")>
    <DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
    <BinarySerializationPropertyAttribute()>
    Public Property Charts As ChartCollection
    'Usage
     
    Dim instance As ChartServerControl
    Dim value As ChartCollection
     
    instance.Charts = value
     
    value = instance.Charts
    [Category("Xceed Chart for ASP.NET")]
    [Description("Retrieves the charts collection of the component")]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    [BinarySerializationProperty()]
    public ChartCollection Charts {get; set;}
    Remarks
    Xceed Chart for WinForms supports an unlimited number of charts to be displayed in the chart control canvas. Each chart is represented by a Chart object contained by the Charts collection of the control. By default the collection contains only one chart.
    Example
    The following example modifies the first chart in the chart collection
    Dim Bar1 As BarSeries
    Dim Bar2 As BarSeries
    Dim Bar3 As BarSeries
    Dim Chart As Chart
    Chart = ChartServerControl1.Charts.GetAt(0)
    
    ' add the first bar
    Bar1 = CType(Chart.Series.Add(SeriesType.Bar), BarSeries)
    Bar1.Name = "Bar1"
    Bar1.MultiBarMode = MultiBarMode.Series
    
    ' add the second bar
    Bar2 = CType(Chart.Series.Add(SeriesType.Bar), BarSeries)
    Bar2.Name = "Bar2"
    Bar2.MultiBarMode = MultiBarMode.Stacked
     
    ' add the third bar
    Bar3 = CType(Chart.Series.Add(SeriesType.Bar), BarSeries)
    Bar3.Name = "Bar3"
    Bar3.MultiBarMode = MultiBarMode.Stacked
    
    ' change the color of the second and third bars
    Bar2.BarFillEffect.SetSolidColor(Color.Chocolate)
    Bar3.BarFillEffect.SetSolidColor(Color.Bisque)
    
    Bar1.DataLabels.Mode = DataLabelsMode.None
    Bar2.DataLabels.Mode = DataLabelsMode.None
    Bar3.DataLabels.Mode = DataLabelsMode.None
     
    Bar1.BarStyle = BarStyle.Pyramid
    Bar2.BarStyle = BarStyle.Pyramid
    Bar3.BarStyle = BarStyle.Pyramid
     
    Bar1.Values.FillRandomRange(5, 20, 100)
    Bar2.Values.FillRandomRange(5, 20, 100)  
    Bar3.Values.FillRandomRange(5, 20, 100)  
    
    Chart.Wall(ChartWallType.Back).Visible = False
    Chart.Wall(ChartWallType.Left).Visible = False
     
    Chart.Chart3DView.SetPredefinedProjection(PredefinedProjection.OrthogonalHalf)
    BarSeries Bar1;
    BarSeries Bar2;
    BarSeries Bar3;
    Chart Chart;
    Chart = ChartServerControl1.Charts.GetAt(0);
    
    // add the first bar
    Bar1 = (NBarSeries)Chart.Series.Add(SeriesType.Bar);
    Bar1.Name = "Bar1";
    Bar1.MultiBarMode = MultiBarMode.Series;
    
    // add the second bar
    Bar2 = (NBarSeries)Chart.Series.Add(SeriesType.Bar);
    Bar2.Name = "Bar2";
    Bar2.MultiBarMode = MultiBarMode.Stacked;
    
    // add the third bar
    Bar3 = (NBarSeries)Chart.Series.Add(SeriesType.Bar);
    Bar3.Name = "Bar3";
    Bar3.MultiBarMode = MultiBarMode.Stacked;
    
    // change the color of the second and third bars
    Bar2.BarFillEffect.SetSolidColor(Color.Chocolate);
    Bar3.BarFillEffect.SetSolidColor(Color.Bisque);
    
    Bar1.DataLabels.Mode = DataLabelsMode.None;
    Bar2.DataLabels.Mode = DataLabelsMode.None;
    Bar3.DataLabels.Mode = DataLabelsMode.None;
    
    Bar1.BarStyle = BarStyle.Pyramid;
    Bar2.BarStyle = BarStyle.Pyramid;
    Bar3.BarStyle = BarStyle.Pyramid;
    
    Bar1.Values.FillRandomRange(5, 20, 100);
    Bar2.Values.FillRandomRange(5, 20, 100);  
    Bar3.Values.FillRandomRange(5, 20, 100);  
    
    Chart.Wall(ChartWallType.Back).Visible = false;
    Chart.Wall(ChartWallType.Left).Visible = false;
    
    Chart.Chart3DView.SetPredefinedProjection(PredefinedProjection.OrthogonalHalf);
    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