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

Getting at series of a TeeChart

edited March 2002 in General
I have placed a TeeChart on a report and have used the Edit Chart dialog to
add 5 series to the chart (Series1 thru Series5). This chart is the only
thing on the chart besides some static labels, page #, etc. How do I access
each of the series in my code in order to add data points? I am used to
doing things like:

Series1.Add(....)

However, for some reason, it does not appear that this can be done this way
when the chart is on a report.

Also, when (in what event) should I actually do the population of the chart?
I am assuming that, in this case, I would do it in the BeforePrint event of
the report.

NOTE: I am using Delphi 6 and ReportBuilder 6.03 and I have the full version
of TeeChart Pro 5.02.

Comments

  • edited March 2002
    On a related note...

    When using a DBChart, how does one assign a datasource to a chart? data to
    different series?

  • edited March 2002
    You could do it in the BeforePrint of the band it is located in. The Series
    is accessible via the TppTeeChart.Chart poperty.

    ppTeeChart1.Chart.Series[0]


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited March 2002
    The code to assignthe datapipeline to a Series is something like this.

    ppDPTeeChart1.Chart.Series[0].DataSource := ppReport1.DataPipeline;

    We just create a wrapper around Teechart with out TppDBTeeChart class. Once
    you have access to the Chart, you should be able to use the Teechart
    reference help on configuring the Chart via code.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited March 2002
    It seems that a lot of stuff has to be done through code as opposed to in
    the designer (like one might do if putting a TeeChart on a form). In light
    of this, are there any good samples of how to do coding for a stacked bar
    chart with like 3 series. Data might look something like the following:

    Month1 Large 200
    Month1 Medium 100
    Month1 Small 100
    Month2 Large 300
    Month2 Medium 150
    Month2 Small 50
    .
    .
    .
    Month12 Large 250
    Month12 Medium 125
    Month12 Small 100

    What I really want is as follows:
    x 3 bar series: one for Large, one for Medium, and one for Small
    x labels on the x-axis indicating the month
    x an additional series that is a line graph showing the total of the
    other three series

    I guess the bottom line of my question is are there any good demos about
    doing charts on ReportBuilder reports?

  • edited March 2002
    You should be able to create the charts from the report designer, by right
    clicking over the chart and choosing Edit Chart from the popup window. You
    should then see the entire Teechart editor "dialog" which gives you the
    ability to create the chart visually.

    We don't have any demos specifically for creating charts in RB. Your best
    bet is to contact the TeeChart guys for more information on creating charts
    at runtime. The TppTeeChart.Chart property gives you access to the
    TCustomChart (the Teechart class) that our RB Teechart wrapper components
    'wrap.'


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.