GoInstruments Date Line


#1

Hi,
The GoInstruments for the web looks very handy, I would like to know (after looking at the demo and noticing the ruler) if we can have a ruler that displays a time line (min’s hours) or date line (days/weeks)etc. This would be a very good feature to have as we could easily incorporate time line functionality in to our product. Looking at the Help Document I only saw that you could give it a range of doubles.
Futher more, how difficult would it be to find the X Posistion on the scale for an arbitary number/date etc. Also Can we click on a number on the ruler? Would it use GetValueAtPoint?
Regards,
Paul Kinlan


#2

You could override GraduatedScale.GetLabelString to produce what you want to display, given a double that means some time or date in your system. (System.Convert, alas, doesn’t help convert between double and DateTime.)
I think you are interested in the GraduatedScale.GetValueAtPoint and GetPointForValue methods.
Tick labels are not real objects, they are just drawn, so the normal expectations for being able to click on them don’t apply. But you might be able to figure out which label is at a point by using the GraduatedScale.GetLabelCenter method.


#3

I don’t think it would be that hard thinking about it. Since I would be aiming to have a chronological view of the diagram. The earliest date would be 0.0 and the largest some maximum, each day/month etc in between is +1.0. Additionally I rembember writing code months ago to convert a date to a number. It was some thing like years* 360 + months * 12 + day or something or other. I could then set the major tick point to be x months etc.
Cheers for the help, I will give it some futher throught.
Regards,
Paul