cancel
Showing results for 
Search instead for 
Did you mean: 

How to add invisible data points to Dynamic Graph widget. GraphElementLine looks like a Tetris block

VSimu.1
Associate III

Hello,

We need to add "placeholder" data points. Such that we can have a line in the Graph (for example current sensor data). We read the data every 1 second. And if the sensor gets disconnected, then we want to just not draw anything for that time data point.

We have managed to hack this functionality into the Dynamic Graph by saying "make the lineWidth = 0, to make it invisible" inside of GraphElements.cpp GraphElementLine::drawIndexRange(). If we want the data point or data points to be "invisible", then we change the lineWidth they are drawn as to achieve our result

However, we have a problem. The line endings look like a Tetris block. We have played around with this and figured out that it is not due to the lineWidth changing from 0 to 2, and then 2 to 0 again. But instead this is simply how the Lines are rendered by the Canvas class.

Can you please help us in either fixing the endings of these lines, so that they are flat (as when the first data point is drawn inside of GraphScroll). Using the Gaps did not help, because we can have multiple gaps in our Line. So we are not exactly sure how to do this. The other idea was to make the color of the line segment drawn transparent at that point. But it seems even then we would have this problem that the edges look like tetris blocks.

0693W00000AMlLZQA1.png 

Another screenshot of another try in fixing this. Drawing boxes on top of the line, it is possible to see what is going on. Only this 1 single line segment has the wrong lineWidth=1. I am not sure why on this transition between lineWidth=2 to lineWidth=0, it does this.

0693W00000AN2JzQAL.png 

@Romain DIELEMAN​ Maybe you can just tell me which source files are responsible for this. That would be a huge help too. Then we can just dig deeper there, and probably figure it out ourselves. Even when I do other things unrelated to making the lineWidth=0, it still does this weird thing of drawing the line slightly thinner. So it is not directly related to our hack of making the lineWidth=0. It has to be something to do with the rending. But we have no idea even where to look for this.

0 REPLIES 0