Microsoft Developer Network >
Página principal de foros
>
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.
Respuestas
- Check Axis.StripLines collection. You can find more information about striplines in the samples.
Alex.
http://blogs.msdn.com/alexgor- Propuesto como respuestaAlex GorevMSFT, Propietariomiércoles, 17 de junio de 2009 16:28
- Marcado como respuestaseriousme viernes, 03 de julio de 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- Marcado como respuestaseriousme viernes, 03 de julio de 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- Marcado como respuestaseriousme viernes, 03 de julio de 2009 10:14
Todas las respuestas
- Check Axis.StripLines collection. You can find more information about striplines in the samples.
Alex.
http://blogs.msdn.com/alexgor- Propuesto como respuestaAlex GorevMSFT, Propietariomiércoles, 17 de junio de 2009 16:28
- Marcado como respuestaseriousme viernes, 03 de julio de 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- Marcado como respuestaseriousme viernes, 03 de julio de 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- Marcado como respuestaseriousme viernes, 03 de julio de 2009 10:14
- Thanks, it is perfect.

