.NET Framework Developer Center >
.NET Development Forums
>
Chart Controls for .NET Framework
>
Draw vertical delimiters
Draw vertical delimiters
- Hello,
is there a way to draw vertical lines that does not represent datas but simple delimiters ?
These delimiters would be used to highlight important X values (dates), for example the beginning of a new year.
Thanks.
Answers
- Check Axis.StripLines collection. You can find more information about striplines in the samples.
Alex.
http://blogs.msdn.com/alexgor- Proposed As Answer byAlex GorevMSFT, OwnerWednesday, June 17, 2009 4:28 PM
- Marked As Answer byseriousme Friday, July 03, 2009 10:15 AM
- You can do it with code like this:
DateTime date = new DateTime(2003, 1, 2); StripLine sl = new StripLine() { BorderColor = Color.Red, BorderWidth = 3, BorderDashStyle = ChartDashStyle.Solid, IntervalOffset = date.ToOADate() };
Alex.
http://blogs.msdn.com/alexgor- Marked As Answer byseriousme Friday, July 03, 2009 10:15 AM
- If stripline width is set to zero it should be drawn on top of the gridline.
Alex.
http://blogs.msdn.com/alexgor- Marked As Answer byseriousme Friday, July 03, 2009 10:14 AM
All Replies
- Check Axis.StripLines collection. You can find more information about striplines in the samples.
Alex.
http://blogs.msdn.com/alexgor- Proposed As Answer byAlex GorevMSFT, OwnerWednesday, June 17, 2009 4:28 PM
- Marked As Answer byseriousme Friday, July 03, 2009 10:15 AM
- Thanks for your answer, it is almost that.
But I would like to highlight arbitrary dates, for example the "01/02/2003" date.
"StripLine" does not seem to contain such a property.
Is there a way to set arbitrary dates ? - You can do it with code like this:
DateTime date = new DateTime(2003, 1, 2); StripLine sl = new StripLine() { BorderColor = Color.Red, BorderWidth = 3, BorderDashStyle = ChartDashStyle.Solid, IntervalOffset = date.ToOADate() };
Alex.
http://blogs.msdn.com/alexgor- Marked As Answer byseriousme Friday, July 03, 2009 10:15 AM
- Thanks a lot.
The only remaining problem is that when a custom stripline is at the same position that an original one, the black ones, it is hidden.
How to give the priority to the custom ones ?
- If stripline width is set to zero it should be drawn on top of the gridline.
Alex.
http://blogs.msdn.com/alexgor- Marked As Answer byseriousme Friday, July 03, 2009 10:14 AM
- Thanks, it is perfect.


