Skip to content

Add Method

Description

Adds a new ChartSeries to the chart's collection of series.

Syntax

Public Function Add( _
    ByVal [Name](#) As String _
) As [ChartSeries](XtremeChartControl~ChartSeries.md)

Parameters

  • Name: Text string of the name for this series. This will be the text displayed in the legend for this series.

Return Type

Reference to the ChartSeries to be added.

Remarks

This will add a new series to the chart. Typically, after you add a new series, you take the ChartSeries returned and set its style to the type of series you need (bar, pie, pie 3D, etc.). The sample below shows three series added and then set to be bar series.

Example

' Sample uses Add to add series to the chart

Dim Series As ChartSeries  
Set Series = ChartControl.Content.Series.Add("Quoted")  

Series.Points.Add "Sam", 11  
Series.Points.Add "Jesse", 12  
Series.Points.Add "Dave", 4.5  
Series.Points.Add "Max", 6  
Series.Points.Add "Brian", 5  

Set Series = ChartControl.Content.Series.Add("Hourly")  
Series.Points.Add "Sam", 12  
Series.Points.Add "Jesse", 9.5  
Series.Points.Add "Dave", 5  
Series.Points.Add "Max", 12  
Series.Points.Add "Brian", 11

Set Series = ChartControl.Content.Series.Add("Unbillable")  
Series.Points.Add "Sam", 7  
Series.Points.Add "Jesse", 2  
Series.Points.Add "Dave", 5  
Series.Points.Add "Max", 1  
Series.Points.Add "Brian", 4

Set ChartControl.Content.Series(0).Style = New ChartBarSeriesStyle  
Set ChartControl.Content.Series(1).Style = New ChartBarSeriesStyle  
Set ChartControl.Content.Series(2).Style = New ChartBarSeriesStyle  

Dim Diagram As ChartDiagram2D  
Set Diagram = ChartControl.Content.Diagrams(0)  

Diagram.AxisY.Title.Visible = True  
Diagram.AxisY.Title.Text = "Hours"  
Diagram.AxisX.Title.Visible = True  
Diagram.AxisX.Title.Text = "Employee"

See Also

ChartSeriesCollection Collection


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.