TfrChartView : Dynamic chart construction

Hello,

I wish to be able to generate a Chart and fill the memo property directly
in using the interpretor.

I have problem to do that. I tried to use frVariables but the chart is not
using the variable's values but the variable names or I get errors:

Chart.Memo.Clear;
Chart.Memo.Add('Monday;Tuesday');
Chart.Memo.Add('[NbApjt2];[NbApjt3]');
=> this use the value 2 and 3 in the chart

Chart.Memo.Clear;
Chart.Memo.Add('Lundi;mardi');
Chart.Memo.Add([NbApjt2]+';'+[NbApjt3]);
=> this produce a variant conversion error (string to double)

Chart.Memo.Clear;
Chart.Memo.Add('Lundi;mardi');
Chart.Memo.Add(IntToStr([NbApjt2])+';'+IntToStr([NbApjt3]));
=> this produces also a variant conversion error (null to string


How to build the memo and particulary the serie's data ?

Thanks
Emmanuel

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:00AM
    It is actually easier to have a chart form in delphi and assign that chart to the chart object at run time
    The chart object is limited and depends upon 2 memo object's(by their name) contents to retreive values for series and legend.
    regards ;)
  • edited 3:00AM
    >It is actually easier to have a chart form in delphi and assign that chart >to the chart object at run time
    >The chart object is limited and depends upon 2 memo object's(by their >name) contents to retreive values for series and legend.
    >regards

    I know that it is easyer, but I wished to be able to initialize completely the chart manually with the script language.

    Is it possible to do that ?
    Thanks
    Emmanuel
  • edited 3:00AM
    I want to create a report with a page header and the reset of the page will be a chart.

    I have found using TfrChart to be very limiting in the fact that I can't change the properties at run-time.

    I have been reading that about the solution where one creates a TDBChart on their form and then assigning it to the TfrChartView in the Report's OnBeforePrint() event.

    I have NOT been able to get this to work. How do I set this up EXACTLY? Do I need a Master Report Band (I am assuming the chart's data is coming from the datasource in the form's TDBChart object)?

    Any how, an ACTUAL working example would be appreciated so we don't have to play 500 questions.

    Thanks in advance,

    Shane
  • gordkgordk St.Catherines On. Canada.
    edited 3:00AM
    Hi Shane
    see my reply to your post in the yahoo group and see the chartdemo in the files section or the same demo posted on fastreports.public.binaries news group
    BTW any one using delhi6 or later turn on your auto codecompletion and you'llfind all these little goodies. You can't seem to get at them from the internal script but you can by loading report using, findobject method and modifying props then calling appropriate action. or in reportcomponents events, like on before print
    eg in obp of report component.
    if view.name = 'Chart1' then
    tfrchartview(view).Chartoptions.ChartType := 1;
    regards ;)
  • edited 3:00AM
    I finally figured out how to get to the ChartOptions property (via reading some of you old posts).

    One more question: Do you know how to format the fields? I would like to have my float fields formatted as $,0.00 and I cannot for the life of me figure out to accomplish this.

    Regards and thanks for the help,

    Shane
  • gordkgordk St.Catherines On. Canada.
    edited 3:00AM
    Hi Shane
    if you are working with chart object using memos try setting the display format for the memo to number custom if you are having a problem with the format mask it
    probably needs extra apostrophes.
    Also if what you are trying to set is a deep down property of Tchart then you are better to use tchart and the assign methods.
    I have a report I use with 3 hidden pages that gathers sales journal data from 3 different databases breaks it down by month passes data out to the chart's series'
    using onuserfunctions
    and assigns the chart to a chart object on the 4th and only visible page, of the report.
    regards ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.