Hi,
The following code is my test using new version.
Dim chart As Chart = New Chart
' Adds a empty stacked bar for get a little space from x axis line
' This is not the best solution. Moving x axis down is better, but very complicated
' that will chage the whole axis's position, axis labels, tick markers, axis title and so no.
' Latter version may be consider implete it. But I doubt is this worth work
Dim s0 As Series = New Series
s0.ChartType = ChartType.Bar
s0.CustomAttributes.IsBarStacked = True
s0.DataPoints.Add(1, 50)
s0.DataPoints.Add(2, 50)
s0.DataPoints.Add(3, 50)
s0.DataPoints.Add(4, 50)
s0.DataPoints.Add(5, 50)
s0.DataPoints.Add(6, 50)
s0.DataPoints.Add(7, 50)
s0.DataPoints.Add(8, 50)
s0.DataPoints.Add(9, 50)
s0.DataPoints.Add(10, 50)
s0.DataPoints.Add(11, 50)
s0.DataPoints.Add(12, 50)
s0.DataPoints.Add(13, 50)
s0.DataPoints.Add(14, 50)
s0.DataPoints.Add(15, 50)
s0.DataPoints.Add(16, 50)
s0.DataPoints.Add(17, 50)
s0.DataPoints.Add(18, 50)
s0.DataPoints.Add(19, 50)
s0.DataPoints.Add(20, 50)
s0.DataPoints.Add(21, 50)
s0.DataPoints.Add(22, 50)
s0.DataPoints.Add(23, 50)
s0.DataPoints.Add(24, 50)
Dim i As Integer
For i = 0 To 23 Step i + 1
s0.DataPoints(i).BorderColor = Color.Empty
s0.DataPoints(i).Color = Color.Empty
Next
chart.SeriesCollection.Add(s0)
Dim s As Series = New Series
s.ChartType = ChartType.Bar
s.CustomAttributes.IsBarStacked = True
s.DefaultDataPoint.Color = System.Drawing.Color.FromArgb(255, 0, 0, 0)
s.DataPoints.Add(1, 56)
s.DataPoints.Add(2, 179)
s.DataPoints.Add(3, 82)
s.DataPoints.Add(4, 267)
s.DataPoints.Add(5, 390)
s.DataPoints.Add(6, 412)
s.DataPoints.Add(7, 79)
s.DataPoints.Add(8, 80)
s.DataPoints.Add(9, 20)
s.DataPoints.Add(10, 1330)
s.DataPoints.Add(11, 2230)
s.DataPoints.Add(12, 2530)
s.DataPoints.Add(13, 4230)
s.DataPoints.Add(14, 2730)
s.DataPoints.Add(15, 2030)
s.DataPoints.Add(16, 3230)
s.DataPoints.Add(17, 3330)
s.DataPoints.Add(18, 3930)
s.DataPoints.Add(19, 2930)
s.DataPoints.Add(20, 1130)
s.DataPoints.Add(21, 930)
s.DataPoints.Add(22, 530)
s.DataPoints.Add(23, 230)
s.DataPoints.Add(24, 30)
chart.ChartArea.AxisX.IsMajorGridVisible = False
chart.ChartArea.AxisY2.IsVisible = False
chart.ChartArea.AxisX.Title.Text = "Hours of The Day"
chart.ChartArea.AxisY.Title.Text = "No of Calls"
chart.ChartArea.AxisX.IsAutoCalc = False
chart.ChartArea.AxisX.Interval = 1
chart.ChartArea.AxisX.Minimum = 0
chart.ChartArea.AxisX.Maximum = 24
chart.ChartArea.AxisX.IntervalType = IntervalType.Int
chart.ChartArea.Margin = 4
chart.ChartArea.MarginRight = 20
' Point2Offset is new property and is not perfect. Currently, we only use it to extend axis line
chart.ChartArea.AxisX.Point2Offset = New PointF(15, 0)
chart.ChartArea.Transparence = 255
chart.BackColor = System.Drawing.Color.FromArgb(224, 236, 248)
chart.ChartArea().BackColor = System.Drawing.Color.FromArgb(224, 236, 248)
chart.ChartArea.AxisX.Color = System.Drawing.Color.Black
chart.ChartArea.AxisY.Color = System.Drawing.Color.Black
chart.ChartArea.AxisX.MajorTickMark.Length = 0
chart.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
chart.ChartArea.LegendBox.IsVisible = False
chart.SeriesCollection.Add(s)
chart.Height = 238
chart.Width = 381
Roger Mo
Developer
Aspose Nanjing Team
Contact Us