I've got a ScatterChart set up that shows data that is both positive and negative on the Y axis. I'd like to have a horizontal red line on the chart that shows where Y = 0.
What is the preferred way of doing this? Is there a setting I'm missing, would I need to override a paint event, or would I need to set up a second datatable to plot the line?
Update: I've found the FillSceneGraph event in another message, and will upgrade from 7.1 to 7.3 and give that a try.
Okay, I've upgraded to 7.3 and have been able to add a sample line to the chart.
The line I added was in screen coordinates, but are there any tools to help convert graph coordinates into screen coordinates, as well as to determine the minimum and maximum bounds of the graph coordinates?
Sometimes I just need to write down the question in order to reason out where to look for the answer.
Here's the code that works:
Private Sub chartSelected_FillSceneGraph(ByVal sender As Object, ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) Handles chartSelected.FillSceneGraphDim lineZero As New Infragistics.UltraChart.Core.Primitives.Line Dim yAxis As Infragistics.UltraChart.Core.IAdvanceAxis = CType(e.Grid("Y"), Infragistics.UltraChart.Core.IAdvanceAxis)lineZero.p1.Y = CInt(yAxis.Map(0)) lineZero.p1.X = e.ChartCore.GridLayerBounds.Left lineZero.p2.Y = lineZero.p1.Y lineZero.p2.X = e.ChartCore.GridLayerBounds.Right lineZero.PE.Stroke = Color.Red e.SceneGraph.Add(lineZero) End Sub
Private Sub chartSelected_FillSceneGraph(ByVal sender As Object, ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) Handles chartSelected.FillSceneGraph
Dim yAxis As Infragistics.UltraChart.Core.IAdvanceAxis = CType(e.Grid("Y"), Infragistics.UltraChart.Core.IAdvanceAxis)
lineZero.p1.X = e.ChartCore.GridLayerBounds.Left
lineZero.p2.Y = lineZero.p1.Y
lineZero.p2.X = e.ChartCore.GridLayerBounds.Right
lineZero.PE.Stroke = Color.Red
e.SceneGraph.Add(lineZero)
End Sub