I want to draw an Elipse primitive on a ScatterChart with a datetime X axis.
How do i convert my date value on the x axis into something that is in the correct cooridnate for the Point object?
In reality i have an array of XY pairs (Doubles, DataTimes). If a value pair meets a certain condition i want to paint a red circle around its marker.
Here is my example (not working).
Dim x As Integer = CInt(System.DateTime.Parse("24-May-06").ToOADate())Dim y As Integer = 11117.32
Dim p As Point = New Point(x, y)
Dim xb As Ellipse = New Ellipse(p, 10)
xb.PE.Fill = Color.Emptyxb.PE.Stroke = Color.Red
e.SceneGraph.Add(xb)
Ok, something new but still not perfect:
The following code works but what about the conversion between double and integer on the Y axis. We loose precision. I am not worried about the xaxis because all my dates will be in days so conversion always results in a wholer number.
Is there a better way?
Dim axisY As IAdvanceAxis = TryCast(e.Grid("Y"), IAdvanceAxis)Dim axisX As IAdvanceAxis = TryCast(e.Grid("X"), IAdvanceAxis)
Dim x As Integer = CInt(axisX.Map(System.DateTime.Parse("30-May-06")))Dim y As Integer = CInt(axisY.Map(11117.32))
Ok, last message.
I guess it works because the map function returns units in pixels.
Pat,
Are you all set now?
Michael S.