TChart Tool-Properties

edited 3:54AM in FastScript
Hello,

I want change some properties of a TChart/TfrxChartView object in the code section of the report: here properties of the section 'tools'...

In the charteditor I can change/add/delete 'tools'-objects like the 'colorband'-tool..., but I want to change it in the code section and don't know the right property names.

I can do it, if I use (in Delphi) a TeeChart component like this
type
  TForm1 = class(TForm)
    Chart1: TChart;
    Series1: TBarSeries;
    ChartTool1: TColorBandTool;
    TrackBar1: TTrackBar;
    procedure FormShow(Sender: TObject);
    procedure TrackBar1Change(Sender: TObject);
  private
  public
  end;

...

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  ChartTool1.Gradient.Colors.Item[0].Offset:=0;
  ChartTool1.Gradient.Colors.Item[1].Offset:=TrackBar1.Position / 100;
  ChartTool1.Gradient.Colors.Item[2].Offset:=1;

  ChartTool1.Gradient.StartColor:=clGreen;
  ChartTool1.Gradient.MidColor:=clYellow;
  ChartTool1.Gradient.EndColor:=clRed;
end;

How can I do this in the code section?
procedure Page1OnBeforePrint(Sender: TfrxComponent);
begin
  Chart1.ChartTool1...???
end;

Thanks

Comments

  • edited 3:54AM
    Sorry, wrong forum
    Moved to FR4


    fs1967 wrote: »
    Hello,

    I want change some properties of a TChart/TfrxChartView object in the code section of the report: here properties of the section 'tools'...

    In the charteditor I can change/add/delete 'tools'-objects like the 'colorband'-tool..., but I want to change it in the code section and don't know the right property names.

    I can do it, if I use (in Delphi) a TeeChart component like this
    type
      TForm1 = class(TForm)
        Chart1: TChart;
        Series1: TBarSeries;
        ChartTool1: TColorBandTool;
        TrackBar1: TTrackBar;
        procedure FormShow(Sender: TObject);
        procedure TrackBar1Change(Sender: TObject);
      private
      public
      end;
    
    ...
    
    procedure TForm1.TrackBar1Change(Sender: TObject);
    begin
      ChartTool1.Gradient.Colors.Item[0].Offset:=0;
      ChartTool1.Gradient.Colors.Item[1].Offset:=TrackBar1.Position / 100;
      ChartTool1.Gradient.Colors.Item[2].Offset:=1;
    
      ChartTool1.Gradient.StartColor:=clGreen;
      ChartTool1.Gradient.MidColor:=clYellow;
      ChartTool1.Gradient.EndColor:=clRed;
    end;
    

    How can I do this in the code section?
    procedure Page1OnBeforePrint(Sender: TfrxComponent);
    begin
      Chart1.ChartTool1...???
    end;
    

    Thanks

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.