MaksTip

TeeChart for ActiveX, COM and ASP
Post Reply
Rousseau
Newbie
Newbie
Posts: 31
Joined: Fri Oct 13, 2006 12:00 am
Location: St-Jean-Port-Joli, Canada
Contact:

MaksTip

Post by Rousseau » Tue Sep 22, 2009 2:26 pm

Hi,

I think this is not possible but I ask the question anyway. I have two series stacked. I created the tcMarksTip tool and the marks on the top are visible. I would like to display two diffetent values on the each marks (on tcMarksTip tool = value, on marks = total of two series). Is it possible to do something like that ?


Thank you
tcmarkstip.JPG
tcmarkstip.JPG (16.42 KiB) Viewed 6962 times

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

Re: MaksTip

Post by Yeray » Tue Sep 22, 2009 3:36 pm

Hi Rousseau,

Yes, if I understand well this example is doing what you are trying to achieve:

Code: Select all

Private Sub Form_Load()
  TChart1.AddSeries scBar
  TChart1.AddSeries scBar
  
  TChart1.Series(0).Add 3, "", clTeeColor
  TChart1.Series(0).Add 5, "", clTeeColor
  TChart1.Series(0).Marks.Visible = False
  
  TChart1.Series(1).Add 4, "", clTeeColor
  TChart1.Series(1).Add 8, "", clTeeColor
  
  TChart1.Series(0).asBar.MultiBar = mbStacked
  
  TChart1.Tools.Add tcMarksTip
  
  RecalcTotals
End Sub

Private Sub RecalcTotals()
  Dim SeriesIndex, ValueIndex As Integer
  Dim total As Double
  
  For ValueIndex = 0 To TChart1.Series(0).Count - 1
    total = 0
    For SeriesIndex = 0 To TChart1.SeriesCount - 1
      total = total + TChart1.Series(SeriesIndex).YValues.Value(ValueIndex)
    Next SeriesIndex
    TChart1.Series(TChart1.SeriesCount - 1).PointLabel(ValueIndex) = Str$(total)
  Next ValueIndex
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

Rousseau
Newbie
Newbie
Posts: 31
Joined: Fri Oct 13, 2006 12:00 am
Location: St-Jean-Port-Joli, Canada
Contact:

Re: MaksTip

Post by Rousseau » Tue Sep 22, 2009 5:57 pm

Hi Yeray,

It's not exactly what I'm trying to do.

There are some screenshot.

Before to call RecalcTotals.
tcmarkstip1.JPG
tcmarkstip1.JPG (32.37 KiB) Viewed 6942 times
After to call RecalcTotals.
tcmarkstip2.JPG
tcmarkstip2.JPG (36.4 KiB) Viewed 6955 times


The values display with the tcMarksTip change for the total. I try to display each values ( Value of serie(0), Value of serie(1), total of two series).

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

Re: MaksTip

Post by Yeray » Wed Sep 23, 2009 8:21 am

Hi Rousseau,

Excuse me, I forgot one line at Form_Load method, after adding the MarksTip tool:

Code: Select all

TChart1.Tools.Items(0).asMarksTip.Style = smsValue
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

Rousseau
Newbie
Newbie
Posts: 31
Joined: Fri Oct 13, 2006 12:00 am
Location: St-Jean-Port-Joli, Canada
Contact:

Re: MaksTip

Post by Rousseau » Wed Sep 23, 2009 1:09 pm

thanks, that's work exactly as I wanted. :D

Post Reply