Page 1 of 1

Setting and showing values like a hint in Gantt Chart

Posted: Wed Jan 31, 2007 10:52 am
by 6393861
Hello,

I´m working with a Gantt chart using "AddGanttColor" and one series. I need to set a value, and show it like a hint when the user moves the mouse over each Gantt bar point.

How can I do it?

I´m using Delphi 7 and Teechart Standard 4.04 edition

Thanks and best regards

Posted: Wed Jan 31, 2007 11:42 am
by narcis
Hi Ralph,

First of all, please notice that these newsgroups are addressed to TeeChart Pro and TeeChart v7 Standard registered customers. For questions about TeeChart version shipped with Delphi please post your questions at our public newsgroups at news://www.steema.net.

Regarding your technical question, this is not possible with the TeeChart version you are using. TeeChart Pro v7 VCL (current TeeChart version) includes MarkTips tool which already does what you request.

Here you'll find what's included in v7 Pro and Standard versions.

With v4.04 Standard you can try using something like this:

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var Index: Integer;
begin
  Index:=Series1.Clicked(X,Y);


  if (Index<>-1) then
    Chart1.Canvas.TextOut(X,Y,Series1.ValueMarkText[Index]);
  else
    Series1.Repaint;
end;

Posted: Thu Feb 01, 2007 1:29 pm
by 6393861
Hi Narcís,

Thanks for your kind and quick response. I tried your code and it works fine, but only for showing, not setting (I will have to update my old version).

I´m sorry for this wrong newsgroup post (I have "TeeChart Pro v4 VCL" and "TeeChart Pro v3 ActiveX", but not TeeChart Pro v7).

Best regards (y nuevamente, muchas gracias por tu amabilidad)

Posted: Thu Feb 01, 2007 1:58 pm
by narcis
Hi Ralph,

You're very welcome.

Sorry but I misunderstood your original question then. You can also set marks text using the method you mention doing something like this:

Code: Select all

  Series1.AddGanttColor(StartValue,EndValue,Y,'MyMarkText',clTeColor);
You can also customize this text in Series' OnGetMarkText event.