Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - strange results using dotnet chart control

Reply
 
Old 10-28-2009   #1 (permalink)
IB


 
 

strange results using dotnet chart control

vb express, 2008:

I do not get the last point in a stacked area chart. I made a simple
program, but could not reproduce it under test circumstances. Put my simple
test code into my main program, and the problem was still there - so the
same code shows the problem in one project, but not in another, very
strange.

After much experimentation, it seemed to be variable intervals in the X axis
data that was causing the problem, i.e.
4min 3 seconds between the first points, and 1 minute 5 seconds between the
next 2 points.

The code below gives me a chart with a rising orange edge, then a falling
orange edge for a 1/10 of the X distance, in my test project. In my main
project, the chart ends after the rising edge.

Any ideas how this can happen?

Thanks


Private Sub AddControl(ByVal C As Windows.Forms.Control)
Me.Controls.Add(C)
C.BringToFront()
C.Visible = True
End Sub

Private Sub MakeChartCommon(ByVal C As Chart, ByVal Top As Integer,
ByVal Width As Integer)
C.Top = Top
C.Width = Width
If C.ChartAreas.Count = 0 Then
Dim A As New ChartArea
C.ChartAreas.Add(A)
End If

If C.Titles.Count = 0 Then
Dim T As New Title
C.Titles.Add(T)
End If
If C.Legends.Count = 0 Then
Dim L As New Legend
C.Legends.Add(L)
End If
C.BorderSkin.SkinStyle = BorderSkinStyle.FrameThin1
C.BorderSkin.PageColor = Drawing.Color.FromArgb(40, 40, 60)
C.BackColor = Drawing.Color.FromArgb(192, 192, 255)
C.BackGradientStyle = GradientStyle.LeftRight
AddControl(C)

End Sub



Private ColStrings() As String = {"Upline", _
"Downline", _
"User", _
"Production", _
"Idle", _
"Off"}
Private ColColours() As Drawing.Color = {Drawing.Color.FromArgb(255,
128, 0), _
Drawing.Color.FromArgb(255,
255, 0), _
Drawing.Color.FromArgb(255, 0,
0), _
Drawing.Color.FromArgb(0, 196,
0), _
Drawing.Color.FromArgb(64, 64,
128), _
Drawing.Color.FromArgb(64, 32,
64)}



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim C As New Chart
MakeChartCommon(C, 10, 200)
C.ChartAreas(0).BackColor = Drawing.Color.FromArgb(0, 0, 0, 0)
C.ChartAreas(0).AxisY.Enabled = AxisEnabled.False

For Count = 0 To ColStrings.GetLength(0) - 1
Dim S As New Series(ColStrings(Count))
S.Color = ColColours(Count)
S.ChartType = SeriesChartType.StackedArea100
C.Series.Add(S)
Next

Dim DT1 As DateTime = Date.Parse("27/10/2009 16:10:00")
Dim DT2 As DateTime = Date.Parse("27/10/2009 16:20:00")
Dim DT3 As DateTime = Date.Parse("27/10/2009 16:21:00")


C.Series(0).Points.AddXY(DT1, 0)
C.Series(1).Points.AddXY(DT1, 0)
C.Series(2).Points.AddXY(DT1, 0)
C.Series(3).Points.AddXY(DT1, 0)
C.Series(4).Points.AddXY(DT1, 0)
C.Series(5).Points.AddXY(DT1, 100)

C.Series(0).Points.AddXY(DT2, 80)
C.Series(1).Points.AddXY(DT2, 0)
C.Series(2).Points.AddXY(DT2, 0)
C.Series(3).Points.AddXY(DT2, 0)
C.Series(4).Points.AddXY(DT2, 0)
C.Series(5).Points.AddXY(DT2, 20)

C.Series(0).Points.AddXY(DT3, 0)
C.Series(1).Points.AddXY(DT3, 0)
C.Series(2).Points.AddXY(DT3, 0)
C.Series(3).Points.AddXY(DT3, 0)
C.Series(4).Points.AddXY(DT3, 0)
C.Series(5).Points.AddXY(DT3, 100)



End Sub






My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
is the dotnet 2 webbrowser control based on IE 6 or 7? .NET General
Request.Url.GetLeftPart(UriPartial.Authority) - strange results .NET General
Strange Vista Benchmark Results Vista General
Strange dir d*. results Vista file management
[demo] Format-Chart - Formats output as a table with a chart colum PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46