Check with below code.
Private Sub chart1_PrePaint(ByVal sender As Object, ByVal e As ChartPaintEventArgs)
Dim cell As LegendCell = TryCast(e.ChartElement, LegendCell)
If cell IsNot Nothing AndAlso cell.Tag Is Nothing Then
Dim r As RectangleF = e.ChartGraphics.GetAbsoluteRectangle(e.Position.ToRectangleF())
e.ChartGraphics.Graphics.DrawRectangle(Pens.DimGray, Rectangle.Round(r))
If cell.CellSpan <> 1 Then e.ChartGraphics.Graphics.DrawLine(Pens.White, r.Left, r.Top + 1, r.Left, r.Bottom - 1)
End If
End Sub
Private Sub Page_Load(ByVal sender As Object, ByVal e As ChartPaintEventArgs) Handles Me.Load
chart1.Legends(0).Enabled = False
chart1.Legends.Add(New Legend("customLegend"))
Dim L As Legend = chart1.Legends(1)
L.DockedToChartArea = chart1.ChartAreas(0).Name
L.Docking = Docking.Bottom
L.IsDockedInsideChartArea = False
L.Alignment = StringAlignment.Center
addValuesToLegend(L, chart1.Series(0), False)
For Each s As Series In chart1.Series
addValuesToLegend(L, s, True)
Next
End Sub
Private Sub addValuesToLegend(ByVal L As Legend, ByVal S As Series, ByVal addYValues As Boolean)
Dim newItem As LegendItem = New LegendItem()
newItem.MarkerStyle = S.MarkerStyle
newItem.MarkerColor = S.Color
If S.MarkerStyle = MarkerStyle.None Then
newItem.ImageStyle = LegendImageStyle.Rectangle
newItem.BorderColor = Color.Transparent
newItem.Color = S.Color
Else
newItem.ImageStyle = LegendImageStyle.Marker
End If
newItem.Cells.Add(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleCenter)
newItem.Cells.Add(LegendCellType.Text, If(addYValues, S.Name, ""), ContentAlignment.MiddleLeft)
newItem.Cells(1).CellSpan = 2
If Not addYValues Then
newItem.ImageStyle = LegendImageStyle.Line
newItem.Color = Color.Transparent
newItem.Cells(0).Tag = "*"
End If
For Each dp As DataPoint In S.Points
Dim t As String = dp.YValues(0).ToString(S.Tag.ToString())
If Not addYValues Then t = DateTime.FromOADate(dp.XValue).ToString("M\/d\/yyyy")
newItem.Cells.Add(LegendCellType.Text, t, ContentAlignment.MiddleCenter)
Next
For Each cell In newItem.Cells
cell.Margins = New Margins(25, 20, 25, 20)
Next
L.CustomItems.Add(newItem)
End Sub