Page 1 of 1

AntiAlias breaks MouseClick?

Posted: Tue Nov 13, 2007 9:14 pm
by 9526113
I have a bubble chart and I want to display bubble labels on click.

I managed to put together some code that works --- BUT it only works with antialias turned off. (And, the bubbles look VERY bad without antialiasing.

Here's the code:

Code: Select all

  Set rs = GetBubbleRS("Unit", "CEO", "")
  
  With TChart1
    .Aspect.View3D = False
    ';.Canvas.UseAntiAlias = True
    
    With rs
      Do While Not .EOF
        ctr = ctr + 1
        TChart1.Series(0).asBubble.AddBubble !LS, !LL * 100, 2.5, !Item, RGB(0, 0, 255)
        TChart1.Series(0).asBubble.RadiusValues.Value(ctr - 1) = 0.15
        
        .MoveNext
      Loop
    End With
    
    .Series(0).asBubble.Pointer.Gradient.Visible = True
    tmp = .Axis.Left.CalcXSizeValue(.Series(0).asBubble.RadiusValues.First)
    .Axis.Bottom.MinimumOffset = tmp * (1 + 0.4)
    tmp = .Axis.Left.CalcXSizeValue(.Series(0).asBubble.RadiusValues.Last)
    .Axis.Bottom.MaximumOffset = tmp * (1 + 0.4)
    tmp = .Axis.Left.CalcXSizeValue(.Series(0).asBubble.RadiusValues.First)
    .Axis.Left.MinimumOffset = tmp * (1 + 0.4)
    
    .Axis.Bottom.Labels.Style = talValue
    .Zoom.Enable = False
  End With

That works great.

But, if I uncomment this line:

Code: Select all

.Canvas.UseAntiAlias = True
Clicking doesn't work. Two or three bubbles will show a label on click, but it's the wrong label. The other bubbles don't seem to react to the click at all.

Is this a known bug?

How can I have antialiasing on without messing up the Click?

Posted: Wed Nov 14, 2007 9:44 am
by narcis
Hi Productivity Guy,

Which TeeChart version are you using? I've checked that in the code below OnClickSeries event fails in v7 but works fine in TeeChart Pro v8 ActiveX.

Code: Select all

Private Sub Form_Load()
  With TChart1
    .Aspect.View3D = False
    .Canvas.UseAntiAlias = True
    .AddSeries scBubble
   
    For i = 0 To 10
        .Series(0).asBubble.AddBubble i, i, 1, "Bubble " & CStr(i), clTeeColor
    Next i
  End With
End Sub

Private Sub TChart1_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    TChart1.Header.Text.Clear
    TChart1.Header.Text.Add TChart1.Series(SeriesIndex).PointLabel(ValueIndex)
End Sub

Posted: Wed Nov 14, 2007 6:06 pm
by 9526113
Ahh. Yes, I'm using V7. I'll check to see how much the upgrade is.

EDIT: I've just upgraded. Thanks for your help.