Unwanted base lines appear in spline graph created with Visual Basic 2010

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a problem with Spline curves that I hope you may help me with please. The image below illustrates the issue of lines that appear at the base of each curve that is not wanted. Each curve is intended to be open, though a baseline is drawn
joining the first and last points.
<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/104573
Here is the code that generates these spline curves:
<span style="color:green; font-family:Consolas; font-size:9.5pt Prepare the Sun Path Charts
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim ConSolsticeEquinox <span style="color:blue As
<span style="color:blue New <span style="color:#2b91af OleDbConnection(connect_string)

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:green Make a command to select data, data adapter and create dataset
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Cmd <span style="color:blue As <span style="color:blue
New <span style="color:#2b91af OleDbCommand(<span style="color:#a31515 "SELECT * from tblSolsticeEquinox", ConSolsticeEquinox)
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Dta <span style="color:blue As <span style="color:blue
New <span style="color:#2b91af OleDbDataAdapter(<span style="color:#a31515 "SELECT * from tblSolsticeEquinox", ConSolsticeEquinox)
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Dst <span style="color:blue As <span style="color:blue
New <span style="color:#2b91af DataSet

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:green Open database connection
<span style="font-family:Consolas; font-size:9.5pt ConSolsticeEquinox.Open()

<span style="font-family:Consolas; font-size:9.5pt Dta.Fill(Dst,
<span style="color:#a31515 "tblSolsticeEquinox")

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:green Close database connection
<span style="font-family:Consolas; font-size:9.5pt ConSolsticeEquinox.Close()

<span style="font-family:Consolas; font-size:9.5pt Chart1.DataSource = Dst.Tables(<span style="color:#a31515 "tblSolsticeEquinox")

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Series1 <span style="color:blue As <span style="color:#2b91af
Series = Chart1.Series(<span style="color:#a31515 "Winter Solstice")
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series1.Name).XValueMember =
<span style="color:#a31515 "Wazimuth"
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series1.Name).YValueMembers =
<span style="color:#a31515 "Welevation"

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Series2 <span style="color:blue As <span style="color:#2b91af
Series = Chart1.Series(<span style="color:#a31515 "Spring Equinox")
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series2.Name).XValueMember =
<span style="color:#a31515 "Vazimuth"
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series2.Name).YValueMembers =
<span style="color:#a31515 "Velevation"

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Series3 <span style="color:blue As <span style="color:#2b91af
Series = Chart1.Series(<span style="color:#a31515 "Summer Solstice")
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series3.Name).XValueMember =
<span style="color:#a31515 "Sazimuth"
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series3.Name).YValueMembers =
<span style="color:#a31515 "Selevation"

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Series4 <span style="color:blue As <span style="color:#2b91af
Series = Chart1.Series(<span style="color:#a31515 "Autumn Equinox")
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series4.Name).XValueMember =
<span style="color:#a31515 "Fazimuth"
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series4.Name).YValueMembers =
<span style="color:#a31515 "Felevation"

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Series5 <span style="color:blue As <span style="color:#2b91af
Series = Chart1.Series(<span style="color:#a31515 "SunPath Today")
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue For i <span style="color:blue As <span style="color:blue
Integer = 0 <span style="color:blue To AzArray.Count - 1
<span style="font-family:Consolas; font-size:9.5pt Chart1.Series(Series5.Name).Points.AddXY(AzArray(i), SoelArray(i))
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Next

<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Carea <span style="color:blue As <span style="color:#2b91af
ChartArea = Chart1.ChartAreas(0)
<span style="font-family:Consolas; font-size:9.5pt Carea.BackColor =
<span style="color:#2b91af Color.Azure
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:green Format X-axis
<span style="font-family:Consolas; font-size:9.5pt Carea.AxisX.MajorGrid.Enabled =
<span style="color:blue False
<span style="font-family:Consolas; font-size:9.5pt Carea.AxisX.LabelStyle.Format =
<span style="color:#a31515 "0"
<span style="font-family:Consolas; font-size:9.5pt
<span lang="FR-CA" style="font-family:Consolas; font-size:9.5pt Carea.AxisX.Interval = 15
<span lang="FR-CA" style="font-family:Consolas; font-size:9.5pt
<span style="color:green Format Y-axis
<span lang="FR-CA" style="font-family:Consolas; font-size:9.5pt
<span style="font-family:Consolas; font-size:9.5pt Carea.AxisY.MajorGrid.Enabled =
<span style="color:blue True
<span style="font-family:Consolas; font-size:9.5pt Carea.AxisY.MinorGrid.Enabled =
<span style="color:blue False
<span style="font-family:Consolas; font-size:9.5pt Carea.AxisY.LabelStyle.Format =
<span style="color:#a31515 "0"
<span style="font-family:Consolas; font-size:9.5pt Carea.AxisY.Interval = 10
Please tell me why these base lines are appearing and what VB code should be used to get rid of them. Thank-you.
With Sincere Regards,
Dalton

View the full article
 
Back
Top