Page 1 of 1

ColorLine.AllowDrag = False causes ColorLine to disappear

Posted: Tue Apr 08, 2008 11:53 am
by 9642657
I'm using the latest release (6th Mar. 2008) of TeeChart .NET v2 in a VB project.

I have a problem of not being able to create non-draggable ColorLines.

When I add a ColorLine to a Chart and set

Code: Select all

ColorLine1.AllowDrag = False
the ColorLine is not visible in the chart.

If I then use the TeeChart Editor during runtime and go to Tools -> ColorLine and switch "Allow Drag" on, the ColorLine reappears and remains displayed even if I switch "Allow Drag" off again.

Am I doing something wrong or is this a bug?

Posted: Tue Apr 08, 2008 2:38 pm
by narcis
Hi IHWB,

Code below works fine for me here using TeeChart for .NET v2 update build we posted today. Could you please try if today's version works fine at your end? If it doesn't, could you please modify the code below or send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Code: Select all

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim Line1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)
        Line1.FillSampleValues()

        Dim ColorLine1 As New Steema.TeeChart.Tools.ColorLine(TChart1.Chart)
        ColorLine1.Axis = TChart1.Axes.Left
        ColorLine1.Value = Line1.MinYValue() + (Line1.MaxYValue() - Line1.MinYValue()) / 2
        ColorLine1.AllowDrag = False
    End Sub

Posted: Tue Apr 08, 2008 4:04 pm
by 9642657
It seems that I have found the problem:
The disappearing ColorLine occurred because the value of the ColorLine was beyond the axis limits, which is expected behavior, I guess.

The fact that the ColorLine was displayed when I switched on AllowDrag confused me a little.

Thanks for the quick reply, though!