User (Legacy) Posted December 20, 2005 Report Posted December 20, 2005 Hi, I have a series that is displayed as a line graph in a ChartFX for VS .NET 2005 chart. It uses data from a column that has some DBNull values. The line prints out, with the DBNull points printing as hidden points. These hidden points cause breaks in the nice line. I would like the line graph to appear unbroken. I would like a straight line to be drawn from the closest point on its left to the closest point on its right. How can I accomplish this? (Note: I would definitely rather not have to loop through all values and assign fake values to the points that would make the line graph work out to have no line breaks. I realize that I could calculate a weighted average value between the closest point on the left and right, and set the hidden point's value to this fake value.) Thanks a lot for your help, Brook Hunter
Software FX Posted December 21, 2005 Report Posted December 21, 2005 You will need a separate set of dates for each series, your data needs to look like this: Date1 Series1 Date2 Series2 1/1/2001 30 1/1/2001 40 1/3/2001 20 1/4/2001 45 1/6/2001 50 1/5/2001 70 null null 1/6/2001 60 Notice that using this approach, all null values (if any) end up at the end of the dataset. -- Francisco Padron www.chartfx.com
wlo413 Posted February 13, 2009 Report Posted February 13, 2009 I have got a similar issue with this. Working with C#, I am plotting a real time data stream against time where my data arrives at unknown time intervals. My chart is updated once a second, via a timer event that refreshes the chart. Since the data coming is potentially never ending, I dont want to plot every single data sample that has arrived, otherwise, I might end up with a chart that contains an infinate number of data. So I created a scrolling window, where I only plot the last minute or so of data. I need to use a line graph where I pass the chart data as an (x,y) coordinate set, as described in the scatter plot documentation. However, I want my data points to be connected with a line, hence my need to plot this as a line graph. Since my data arrives at irregular intervals, my plot ends up looking like this: chart1.Data.Y[1, 0] = 20; chart1.Data.Y[1, 1] = null; // no data sample at this time chart1.Data.Y[1, 2] = 25; chart1.Data.Y[1, 3] = null; // no data sample at this time chart1.Data.Y[1, 4] = null; // no data sample at this time chart1.Data.Y[1, 5] = 22; chart1.Data.Y[1, 6] = 23; chart1.Data.Y[1, 7] = null; // no data sample at this time .... .... .... .... The line breaks where the data point is null, but I want a continuous line between two available points. I think, essentually, I want a scatter plot that is connected with a line. Is there anyway I can acheive this given the nature of my data?
CarlosAC Posted February 17, 2009 Report Posted February 17, 2009 Hi Brook and wlo413. Unfortunately, you will need to set the calculated value (average) to the hidden point. If you set hidden to the point, the line will be broken.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.