Hello everyone
Why do I get this exception in my program at the momentwhen I try to add a target line in my ultrachart?
The exception says something like this:Error creating form. See Exception.InnerException for more details.Error: Object reference not set to an instance of an object.
I'm using this code to add my target line
Dim target As Double = 1.25 Dim axisY As IAdvanceAxis = TryCast(e.Grid("Y"), IAdvanceAxis) Dim axisX As IAdvanceAxis = TryCast(e.Grid("X"), IAdvanceAxis) Dim targetYCoord As Integer = CInt(axisY.Map(target)) Dim xStart As Integer = CInt(axisX.MapMinimum) Dim xEnd As Integer = CInt(axisX.MapMaximum) Dim targetLine As New Line(New Point(xStart, targetYCoord), New Point(xEnd, targetYCoord))
targetLine.PE.Stroke = Color.Red targetLine.PE.StrokeWidth = 3
e.SceneGraph.Add(targetLine)
I got that exception in this partDim targetYCoord As Integer = CInt(axisY.Map(target))But I don't know why.
Any response or suggestion, I will be very grateful.I want my ultrachart have a similar appearance to the image of the LineGraph.rar filethat I'm attaching. I only have to add the target line ... Please help me.By the way, my code is in the LineGraph.rar too
It is very easy by just looking at the FillSceneGraph sample from Infragistics.
But there is a bug when drawing the target line with Scaling and Scrolling is enable on the chart as I report in this forum also.
See
I saw that example and in that example it works properly (The same code that I'm using ) ,
but I got this exception when I run my application
"Object reference not set to an instance of an object"
I used "Step-by-step debugging" and I got that exception right here:
Dim targetYCoord As Integer = CInt(axisY.Map(target))
Is the same problem that you have and that you reported?
Did you see my code?