Page 1 of 1

Hide part of a line

Posted: Tue Mar 20, 2007 1:38 pm
by 9643849
Let's say I have a normal lineSeries on a chart with, say 10 'points'. Normally one 'line' will be drawn from point 1 to point 2, point 2 to point 3 etc...

But what if I do not want a line do be drawn between point 5 and point 6? I am aware that I can change the color of that 'part of the line', but I'm looking for a way to make it invisible.

I know one way would be to create two series (one from point 1 to 5 and the other from point 6 to 10) but it would make life easier for me if the whole line belonged to the same series, just that part of it was invisible.

Is this possible?

Regards Andreas

Posted: Tue Mar 20, 2007 1:54 pm
by 9643849
Sorry, I was unaware of the Color.Transparent color. It seems to do the trick.

However, I seem to have found a bug. If I make every other linepart transparent, the complete line becomes transparent. Watch this:
myLine.Add(1,5, Color.White)
myLine.Add(2,7)
myLine.Add(3,2, Color.White)
myLine.Add(4,9)
myLine.Add(5,12, Color.White)
myLine.Add(6,7)
The above correctly draws a line with every other linepart white

myLine.Add(1,5, Color.Transparent)
myLine.Add(2,7)
myLine.Add(3,2, Color.Transparent)
myLine.Add(4,9)
myLine.Add(5,12, Color.Transparent)
myLine.Add(6,7)
The above draws a line completly transparent! (At least for me)

Posted: Tue Mar 20, 2007 2:42 pm
by narcis
Hi Wicket,

To have a line displayed you would need two visible points. If you make one visible a segment won't be drawn.

To achieve what you request you could draw a transparent point in the middle of the line segment you want to be transparent. Or even at one of the edges of the segment repeating one of the points. One being transparent and the other not.