Jump to content
Software FX Community

Line chart missing connections when other series are introduced


Recommended Posts

I am in the process of creating a multiple-series line chart representing pH readings, over time, for multiple water wells.  I want the chart to display a chart with one series of points per well for the purposes of comparing wells on the same chart.  I have been able to create the chart, using C#, by iterating through my data and manually adding points as described below:

 Example data set:

Well # 2/20/1998 6/7/2000 10/12/2001 5/6/2003 5/7/2003 9/30/2007
W14 6.21 7.00 6.26 7.80 7.25 5.99
W03 8.24 6.34 7.12 8.10
W16 6.22 7.81 7.14 7.86

Based on what I have read about this so far, I have set the [series, point].value to Chart.Hidden for every point with a null value.  The resulting data points being set should look like this (in [series, point] format):chartObj.XValue[0,0] = 2/20/1998chartObj.Value[0,0] = 6.21chartObj.XValue[0,1] = 6/7/2000chartObj.Value[0,1] = 7.00chartObj.XValue[0,2] = 10/12/2001chartObj.Value[0,2] = 6.26chartObj.XValue[0,3] = 5/6/2003chartObj.Value[0,3] = 7.80chartObj.XValue[0,4] = 5/7/2003chartObj.Value[0,4] = 7.25chartObj.XValue[0,5] = 9/30/2007chartObj.Value[0,5] = 5.99--------------------------------------------------chartObj.XValue[1,0] = 2/20/1998chartObj.Value[1,0] = 8.24chartObj.XValue[1,1] = 6/7/2000chartObj.Value[1,1] = 6.34chartObj.XValue[1,2] = 10/12/2001chartObj.Value[1,2] = Chart.HiddenchartObj.XValue[1,3] = 5/6/2003chartObj.Value[1,3] = Chart.HiddenchartObj.XValue[1,4] = 5/7/2003chartObj.Value[1,4] = 7.12chartObj.XValue[1,5] = 9/30/2007chartObj.Value[1,5] = 8.10--------------------------------------------------chartObj.XValue[2,0] = 2/20/1998chartObj.Value[2,0] = 6.22chartObj.XValue[2,1] = 6/7/2000chartObj.Value[2,1] = Chart.HiddenchartObj.XValue[2,2] = 10/12/2001chartObj.Value[2,2] = 7.81chartObj.XValue[2,3] = 5/6/2003chartObj.Value[2,3] = Chart.HiddenchartObj.XValue[2,4] = 5/7/2003chartObj.Value[2,4] = 7.14chartObj.XValue[2,5] = 9/30/2007chartObj.Value[2,5] = 7.86The null values are handled correctly (with a gap in data points, andthe line connecting the nearest two data points).  The problem existswhen I try to plot more than one well on the chart.  When there aredata points from one line between two points on another line (a linewith gaps in data), then the line breaks and the points are notconnected to the rest of the line.For example, if a chart was generated uning the sample data above, the resulting chart would have 3 series (lines):Series 0 (W14) - Continuous line from 2/20/1998 - 9/30/2007Series1 (W03) - Short line from 2/20/1998 - 6/7/2000 and another short linefrom 5/7/2003 - 9/30/2007 (line segments not connected in the middle)Series2 (W16) - An unconnected point at 2/20/1998, an unconnected point at10/12/2001, and a short line from 5/7/2003 - 9/30/2007I just want to connect the line segments and orphan points within each series to make one continuous line for each well.  How do I do this?

Link to comment
Share on other sites

  • 2 weeks later...


Why don't you just skip the values, instead of making them Hidden?

I.e. change this:

chartObj.XValue[2,0] = 2/20/1998chartObj.Value[2,0] = 6.22chartObj.XValue[2,1] = 6/7/2000chartObj.Value[2,1] = Chart.HiddenchartObj.XValue[2,2] = 10/12/2001chartObj.Value[2,2] = 7.81chartObj.XValue[2,3] = 5/6/2003chartObj.Value[2,3] = Chart.HiddenchartObj.XValue[2,4] = 5/7/2003chartObj.Value[2,4] = 7.14chartObj.XValue[2,5] = 9/30/2007chartObj.Value[2,5] = 7.86

to this:

chartObj.XValue[2,0] = 2/20/1998chartObj.Value[2,0] = 6.22chartObj.XValue[2,1] = 10/12/2001chartObj.Value[2,1] = 7.81chartObj.XValue[2,2] = 5/7/2003chartObj.Value[2,2] = 7.14chartObj.XValue[2,3] = 9/30/2007chartObj.Value[2,3] = 7.86

If you are not using category x-axis, then it should just connect your (x,y)-pairs, without caring about hidden points (if this is what you inteded - I am not sure).

If you have an option to use Bar gallery, you may try it also, it renders hidden points differently.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...