This project is read-only.

Handling null values in a line graph.

Mar 4, 2015 at 3:32 PM

I use Dynamic Data Display to display live distance measurements from a ranging sensor.

The problem I have is when there is no target within the range of the sensor.

Currently in this instance I plot a value 'off the scale', however this produces a vertical line from the last valid point to the top of the graph. I would instead like to represent this simply by a break in the line graph but see no way to do this.

Presumably if a line graph is represented by a number of points, connected by line segments, there must be a way to skip line segments. Does anyone know of a way to achieve this.

Mar 5, 2015 at 6:39 AM

You cannot break the line. DDD does not support this.
think of using two seperate lines.

Mar 5, 2015 at 12:20 PM
Thanks Ravi,

There would be potentially a lot of breaks in the plot so this would result in a number of individual lines drawn and this would be difficult to manage. The data is live and so performance is also an issue.

I have a workaround where I draw over the vertical lines in the background colour, however this introduces gaps in the gridlines. I can (hopefully) remove the gridlines.

I wonder if it would be difficult to add this feature myself. As i mentioned before, if the line graph is represented by a number of points connected by line segments, would it be possible for me to add a flag to the observable data source to decide if the segments should be drawn or not. I am not sure where in the class model to implement this though.

Any ideas.