Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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):

-----------------------------------------------------------------------------------

VB
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
Comments
Maciej Los 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900