Gets or sets the number of horizontal cells used to draw the legend cell's content.
Indicates the number of horizontal cells used to draw the content.
Syntax
Visual Basic (Declaration) |
|
Public Overridable Property CellSpan As Integer |
Visual Basic (Usage) |
Copy Code |
Dim instance As LegendCell
Dim value As Integer
instance.CellSpan = value
value = instance.CellSpan
|
C# |
|
public virtual int CellSpan {get; set;} |
Return Value
The number of horizontal cells used to draw the legend cell content. By default, this value is 1.
Example
In this example we ad two legend cells to a legend item, and then add the legend item to a legend.
Visual Basic |
Copy Code |
Dim legendItem As New LegendItem
legendItem.Cells.Add(New LegendCell(LegendCellType.Text, "United States", ContentAlignment.MiddleLeft)) legendItem.Cells.Add(New LegendCell(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleLeft))
legendItem.Cells(0).CellSpan = 2
chart1.Legends("Default").CustomItems.Add(legendItem)
|
C# |
Copy Code |
// Create new custom legend item. LegendItem legendItem = new LegendItem();
// Add two cells. legendItem.Cells.Add(new LegendCell(LegendCellType.Text, "United States", ContentAlignment.MiddleLeft)); legendItem.Cells.Add(new LegendCell(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleLeft));
// Set the first cell to span two cells. legendItem.Cells[0].CellSpan = 2;
// Add this custom legend item to the chart. chart1.Legends["Default"].CustomItems.Add(legendItem); |
Remarks
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also