custom Legend-like box

TeeChart for ActiveX, COM and ASP
Post Reply
adenin
Newbie
Newbie
Posts: 33
Joined: Mon Jun 11, 2007 12:00 am

custom Legend-like box

Post by adenin » Tue Apr 29, 2008 5:32 am

Hello,

What is the best way for adding box with custom data to chart?

I have legend on the right side of chart and would like to have another
box under it.

I tried Rectangle Tool - but looks like it is not possible to define
its position from upper right corner, only from upper left.(It is needed to define position from upper right corner for me because I use chart on website with flexible size - it fits browser's window size)
(I use TeeChart Pro AX v7)
I also tried to add annotation tool, but I have already used annotation and can't
add another one.

pls, could you help me?
thanks

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Apr 29, 2008 8:11 am

Hi adenin,

It's strange, you should be able to use more than one annotation tool in the same chart. Here you have an example of how you could use several annotation tools and several rectangle tools aligned with the legend.

Code: Select all

Private Sub Form_Load()
Dim i As Integer
  TChart1.AddSeries scLine
  
  TChart1.Series(0).FillSampleValues 10
  TChart1.Panel.MarginRight = 4
  
  TChart1.Environment.InternalRepaint
  
  For i = 0 To 4
    TChart1.Tools.Add tcAnnotate
  
    With TChart1.Tools.Items(i).asAnnotation
      .Text = Str$(i + 1) + ". ANNOTATION"
      .Left = TChart1.Legend.Left
      .Top = TChart1.Legend.ShapeBounds.Bottom + 20 + (i * 25)
    End With
  Next i
  
  For i = 5 To 9
    TChart1.Tools.Add tcRectangle

    With TChart1.Tools.Items(i).asRectangle
      .Text = Str$(i - 4) + ". RECTANGLE"
      .Left = TChart1.Legend.Left
      .Top = TChart1.Legend.ShapeBounds.Bottom + 20 + (i * 25)
      .Height = 20
      .Width = 85
    End With
  Next i
End Sub
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply