Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Getting at Series in TppTeeChart...

edited March 2002 in General
I have a TeeChart on my report. Unfortunately, working with a TeeChart on a
ReportBuilder report is very different from working with them on a form. For
example, I cannot view Series properties in the object inspector. At least,
I don't think I can. Can I? If yes, how? If no, then how do set up code for
a series event? For example, let's say I wanted code like following for the
OnGetMarkText event of Series1:

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
if (Sender = Chart1.Series[0]) and (ValueIndex = 4)
then
else MarkText := ''; // hide everything else
end;

How would I do this?

NOTE: I am using Delphi 6 SP2 and Reportbuilder Enterprise 6.03.

Comments

  • edited March 2002
    The series is not owned by the form like it used to be. You'll have to
    assign the event handler in code at runtime.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited March 2002
    Could you give sample code for implementing the sample event code I included
    in my previous post? Like, would the procedure declaration be

    procedure TForm1.TppTeeChart1.Series1GetMarkText(Sender: TChartSeries;
    ValueIndex: Integer; var MarkText: String);

    and then I'd have code somewhere, like in OnPrint of the Chart, like:

    TppTeeChart1.Series[0].OnGetMarkText := Series1GetMarkText;

    In other words, could you give sample code for creating an event procedure
    and then hooking up the event to the procedure?

    This is really a pain, if I'm understanding this correctly. For one thing,
    one has to know procedure parameters for the events in order to even create
    the procedure declaration, etc..

  • edited March 2002
    Yes, you'll have to have the correct event method signature. It is just
    like hooking into a public event on an object. The object will trigger the
    event, you just need to 'listen' for it. The object (series in this case)
    will determine if it has been assigned the method pointer and call your
    method. The following is an example you asked for:

    http://www.digital-metaphors.com/tips/TeeChartSeriesEventHandler.zip

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.