I have a log file that is saves data every day, each day new data is append to a new line of this log file. I will show you what this log file kind of looks like.
Each log file line has 4 parts of data separated by commas.
03-01-2011,4.05,87,141
03-02-2011,4.10,88,138
03-03-2011,4.17,90,135
03-04-2011,4.20,86,115
03-05-2011,4.25,84,126
03-06-2011,4.31,81,132
03-07-2011,4.35,82,109
03-08-2011,4.42,78,136
03-09-2011,4.47,86,110
03-10-2011,4.53,83,108
I just need my chart to load this log file and loop through it and populate my line chart.
I am able to make a line chart and populate it from a text file but only in a long way. I first load all the data to 10 text boxes, then I split all the data into 40 other text boxes then I use that to populate the chart, There has to be a easier way of doing this. With my current way I can only load up 10 days of data.
I would like to be able to load up 30 days of data or even a years worth (365 entry's)
I am using visual basic 2008 with .NET Framework 4 Chart Controls.
Thanks for reading this.
Some of my code:
The Date has to be at the bottom of this chart (going left to right) and the numbers on the left side.
Each log file line has 4 parts of data separated by commas.
03-01-2011,4.05,87,141
03-02-2011,4.10,88,138
03-03-2011,4.17,90,135
03-04-2011,4.20,86,115
03-05-2011,4.25,84,126
03-06-2011,4.31,81,132
03-07-2011,4.35,82,109
03-08-2011,4.42,78,136
03-09-2011,4.47,86,110
03-10-2011,4.53,83,108
I just need my chart to load this log file and loop through it and populate my line chart.
I am able to make a line chart and populate it from a text file but only in a long way. I first load all the data to 10 text boxes, then I split all the data into 40 other text boxes then I use that to populate the chart, There has to be a easier way of doing this. With my current way I can only load up 10 days of data.
I would like to be able to load up 30 days of data or even a years worth (365 entry's)
I am using visual basic 2008 with .NET Framework 4 Chart Controls.
Thanks for reading this.
Some of my code:
PHP:
Chart1.Series.Clear()
Chart1.Titles.Add("Progress Chart")
'Create a new series and add data points to it.
Dim s As New Series
Dim t As New Series
Dim u As New Series
s.Name = "Weight"
t.Name = "Oxygen"
u.Name = "Heartrate"
'Change to a line graph.
s.ChartType = SeriesChartType.Spline
t.ChartType = SeriesChartType.Spline
u.ChartType = SeriesChartType.Spline
s.Points.AddXY(TextBox1.Text, TextBox11.Text)
s.Points.AddXY(TextBox2.Text, TextBox12.Text)
s.Points.AddXY(TextBox3.Text, TextBox13.Text)
s.Points.AddXY(TextBox4.Text, TextBox14.Text)
s.Points.AddXY(TextBox5.Text, TextBox15.Text)
s.Points.AddXY(TextBox6.Text, TextBox16.Text)
s.Points.AddXY(TextBox7.Text, TextBox17.Text)
s.Points.AddXY(TextBox8.Text, TextBox18.Text)
s.Points.AddXY(TextBox9.Text, TextBox19.Text)
s.Points.AddXY(TextBox10.Text, TextBox20.Text)
t.Points.AddXY(TextBox1.Text, TextBox21.Text)
t.Points.AddXY(TextBox2.Text, TextBox22.Text)
t.Points.AddXY(TextBox3.Text, TextBox23.Text)
t.Points.AddXY(TextBox4.Text, TextBox24.Text)
t.Points.AddXY(TextBox5.Text, TextBox25.Text)
t.Points.AddXY(TextBox6.Text, TextBox26.Text)
t.Points.AddXY(TextBox7.Text, TextBox27.Text)
t.Points.AddXY(TextBox8.Text, TextBox28.Text)
t.Points.AddXY(TextBox9.Text, TextBox29.Text)
t.Points.AddXY(TextBox10.Text, TextBox30.Text)
u.Points.AddXY(TextBox1.Text, TextBox31.Text)
u.Points.AddXY(TextBox2.Text, TextBox32.Text)
u.Points.AddXY(TextBox3.Text, TextBox33.Text)
u.Points.AddXY(TextBox4.Text, TextBox34.Text)
u.Points.AddXY(TextBox5.Text, TextBox35.Text)
u.Points.AddXY(TextBox6.Text, TextBox36.Text)
u.Points.AddXY(TextBox7.Text, TextBox37.Text)
u.Points.AddXY(TextBox8.Text, TextBox38.Text)
u.Points.AddXY(TextBox9.Text, TextBox39.Text)
u.Points.AddXY(TextBox10.Text, TextBox40.Text)
'Add the series to the Chart1 control.
Chart1.Series.Add(s)
Chart1.Series.Add(t)
Chart1.Series.Add(u)
The Date has to be at the bottom of this chart (going left to right) and the numbers on the left side.
Last edited: