MS CHART Line graph problem - a line is drawn from last data point to first data point - can not see a reason why
I am plotting a line graph using MS Chart. Data is sourced from a MS Access table via a select statement, then I retrieve the data using Chart.Datasource, then bind the data using Chart.DataBind. This all seems to work fine other than on the display a straight line is drawn from the last data point to the first data point and I can not see why. I also have one data point that does not have a line drawn to it, so it looks like a break but the data retreived shows valus for all data points.
I have checked the SQL by running it in MS Access and it returns the exact number of results.
Can anyone shed any light on this problem.
The following SQL returns 13 results:
SELECT Wi5minReadings.WiReadingTaken, Wi5minReadings.WiReadingAve, Wi5minReadings.WiReadingMax, Wi5minReadings.WiReadingMin FROM(Wi5minReadings)WHERE ((CDate([Wi5minReadings]![WiReadingTaken]) Between '05/02/2010 07:13:38' And '05/02/2010 08:13:38'));
Query2 WiReadingTaken WiReadingAve WiReadingMax WiReadingMin 05/02/2010 07:53:38 1.22866666666667 1.36 1.1 05/02/2010 07:58:38 1.11933333333333 1.2 1.03 05/02/2010 08:03:38 1.2292 1.26 1.17 05/02/2010 08:08:38 1.26746666666667 1.32 1.22 05/02/2010 08:13:38 1.14666666666667 1.24 1.06 05/02/2010 07:13:38 1.70453333333333 3.14 0 05/02/2010 07:18:38 1.03413333333333 1.06 1.01 05/02/2010 07:23:38 1.2332 1.41 0.93 05/02/2010 07:28:38 1.34066666666667 1.4 1.27 05/02/2010 07:33:38 2.36133333333333 3.04 1.26 05/02/2010 07:38:38 1.93066666666667 3 1.26 05/02/2010 07:43:38 2.56773333333333 3.3 1.16 05/02/2010 07:48:38 2.1112 3.4 1.09Friday, February 05, 2010 10:06 AM
Hi, I have the same issue.
I just created a simple chart with 2 line series.
Points are sorted by date, and added with AddXY function.
I always have a straight line between first and last point of my serie.
Is there any way to fix this issue ?
I had the same problem. I fixed it by performing an InsertXY with an index of zero instead of AddXY. Since the points are drawn on the graph in order, it's important to put the data in the correct place in the series. Since my original query was "[dbtimestamp] desc", it put the newest records at the beginning of the series. Since the data is read periodically from the hardware, the most current reading must be placed at the beginning of the series in order to not cause a line to be drawn all the way across the chart (kind of like a carriage return, if you think about it).
Anyway, try replacing your Series.AddXY(x, y) with Series.InsertXY(0, x, y) and you may see your mysterious line disappear.Monday, April 22, 2013 9:18 PM