Dotted Line Marker for Present


#1

My char uses an SChartDateTime axis for its x axis, and an SChartNumberAxis for its y axis. Some of the data in the chart takes place in the future, and is a projection / estimate about what is to come. 

I want to draw a dotted line, from the top of the chart to the bottom of the chart, indicating the current date & time, effectively dividing the date from the future and the data from the past on its right and left sides respectively. How do I go about doing this?

Thanks, Varun


#2

Hi Varun,

Your best bet would be to use an annotation, setting its x-value to be the boundary between your current and future data. We don’t offer a dashed-line annotation out of the box, however it should be fairly simple for you to create a custom subclass of SChartAnnotation which then uses something like CoreGraphics to draw a dashed line. You may find the ‘AddingAnnotations’ sample included in the download helpful.

I hope that helps you on your way.

Sam