Cообщество разработчиков на платформе Microsoft >
Форумы
>
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.
Ответы
- Check Axis.StripLines collection. You can find more information about striplines in the samples.
Alex.
http://blogs.msdn.com/alexgor- Предложено в качестве ответаAlex GorevMSFT, Владелец17 июня 2009 г. 16:28
- Помечено в качестве ответаseriousme 3 июля 2009 г. 10:15
- 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- Помечено в качестве ответаseriousme 3 июля 2009 г. 10:15
- If stripline width is set to zero it should be drawn on top of the gridline.
Alex.
http://blogs.msdn.com/alexgor- Помечено в качестве ответаseriousme 3 июля 2009 г. 10:14
Все ответы
- Check Axis.StripLines collection. You can find more information about striplines in the samples.
Alex.
http://blogs.msdn.com/alexgor- Предложено в качестве ответаAlex GorevMSFT, Владелец17 июня 2009 г. 16:28
- Помечено в качестве ответаseriousme 3 июля 2009 г. 10:15
- 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- Помечено в качестве ответаseriousme 3 июля 2009 г. 10:15
- 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- Помечено в качестве ответаseriousme 3 июля 2009 г. 10:14
- Thanks, it is perfect.

