Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB8.0 VB
Hi guys,
 
I have searched for a solution for my problem for a long while now. I know it might just be a small issue but right now I can't solve it and I would be really happy getting some help bevore gettin a breakdown :P
 
So what I try to do is streaming data from an external .exe file redirecting the console output to my Chart.Series("Meas"). I have to split the datatransfer into several steps cause the sub program takes a looong while.
 
I got a little loop for the data collection steps and would like to refresh my ChartArea in the end of every loop. Unfortunately it won't work... Wahhh! :P Here is the Part of my Program (I marked the line where i want to refresh my ChartArea):
 
-----------------------------------------------------------------------------------
 
Private Sub GetData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetData.Click
 
        Dim DataSet As String
        Dim GetData As New System.Diagnostics.Process()
        GetData.StartInfo.UseShellExecute = False
        GetData.StartInfo.RedirectStandardOutput = True
        GetData.StartInfo.CreateNoWindow = True
 
        Chart1.Series.Add("Meas")
        Chart1.Series("Meas").ChartType = SeriesChartType.FastLine
 
        For j = 0 To (CDbl(FStop.Text) - CDbl(FStart.Text)) / 10
 
            Dim TempStart As Double
            Dim TempStop As Double
            TempStart = CDbl(FStart.Text) + j
            TempStop = CDbl(FStart.Text) + 10 + j
 
            GetData.StartInfo.FileName = "d:\...\test.exe"
            GetData.StartInfo.Arguments = TempStart & " " & TempStop & " " & RBand.Text & " " & VBand.Text & " " & SweepDelay.Text & " " & IntAmp.Text
 
            GetData.Start()
            DataSet = GetData.StandardOutput.ReadToEnd()
            GetData.WaitForExit()
            GetData.Close()
 
            Dim Hilf_Z As Object
            Hilf_Z = Split(DataSet, vbCrLf)
 
            Dim i As Integer
            For i = 0 To UBound(Hilf_Z) - 2
                Chart1.Series("Meas").Points.AddXY(CDbl(Hilf_Z(i)) * 1000000.0, Val(Hilf_Z(i + 1)))
                i = i + 2
            Next
           
            
            '<-------- here I want to refresh my Chart
            'something like: Chart1.ChartArea("ChartArea1").Refresh()
            'or              Chart1.Series("Meas1").Refresh()
            'can't find any methods...

        Next
    End Sub
 

 
Sorry for my baaad programming skills, and thanks in advance!
Greeeez, Tom
Posted 13-Dec-11 1:00am
Comments
losmac at 19-Jan-12 4:31am
   
Is your chart:
1) Excel.Chart
or
2) System.Web.UI.DataVisualization.Charting.ChartArea
object?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Afzaal Ahmad Zeeshan 170
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 13 Dec 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100