tchart->onclickseries for tpointseries -> no action

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Michael
Newbie
Newbie
Posts: 6
Joined: Fri Jul 23, 2010 12:00 am

tchart->onclickseries for tpointseries -> no action

Post by Michael » Wed Jul 28, 2010 5:59 am

Hello,
I have installed the teechart pro 4.07 for delphi 2009 and the program of replacing standard-teecart for delphi.
I replaced all the old components by new and tested program. I use the onclick event to select a specific function, Unfortunately at tpointseries the onclick event does not fire. I use tlineseries, then the event also triggered it.
what is the problem? what should I do if my program is running again so as before? Or is this a bug?
I would be grateful if you could help me quickly.
Thanks

Michael
Newbie
Newbie
Posts: 6
Joined: Fri Jul 23, 2010 12:00 am

Re: tchart->onclickseries for tpointseries -> no action

Post by Michael » Wed Jul 28, 2010 6:27 am

I again, I test very different curve types with the onclickevent. I now use a smooth tlineseries-chart. i need many attempts to trigger the event. too many.......

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: tchart->onclickseries for tpointseries -> no action

Post by Narcís » Wed Jul 28, 2010 8:43 am

Hi Michael,
I have installed the teechart pro 4.07 for delphi 2009 and the program of replacing standard-teecart for delphi.
I guess you mean 8.07 not 4.07 here, is that correct?

What about using TChart's OnClickSeries event? If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Michael
Newbie
Newbie
Posts: 6
Joined: Fri Jul 23, 2010 12:00 am

Re: tchart->onclickseries for tpointseries -> no action

Post by Michael » Wed Jul 28, 2010 10:21 am

Hello,
hmmm... the version number of the tchart is called :"TeeChart pro v2010.00.00407 Win32". I downloaded it yesterday.
The problem occurs when 2d series on.
here is a little demo. I hope the errors can be understood within. Please click on the series and if successful, it then appears a window. ;-)


Code: Select all

unit Unit2;

interface

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeEngine, Series, StdCtrls, ExtCtrls, TeeProcs, Chart;

type
  TForm2 = class(TForm)
    Chart1: TChart;
    Panel1: TPanel;
    Button1: TButton;
    CheckBox1: TCheckBox;
    procedure Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries;
      ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X,
      Y: Integer);
    procedure Button1Click(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
 var p:Tpointseries;

     l: TLineSeries;
begin
p:=Tpointseries.Create(Chart1);
l:=TLineSeries.Create(Chart1);
with chart1 do begin
View3D:=false;
LeftAxis.SetMinMax(0,21);
BottomAxis.Automatic:=true;
BottomAxis.labelsangle:=90;
BottomAxis.LabelsFont.Size:=9;
BottomAxis.LabelsOnAxis:=true;
BottomAxis.Title.Font.size:=14;
BottomAxis.Title.Font.Color:=clblue;
LeftAxis.LabelsAngle:=90;
LeftAxis.Title.Font.Color:=clblue;
LeftAxis.Title.Font.size:=14;
Title.Font.Size:=16;
AddSeries(p);
AddSeries(l);
end;

p.AddXY(1,5);
p.AddXY(2,1);
p.AddXY(3,9);
p.AddXY(4,12);
p.AddXY(5,7);
l.AddXY(1,15);
l.AddXY(2,11);
l.AddXY(3,19);
l.AddXY(4,22);
l.AddXY(5,17);
end;

procedure TForm2.Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries;
  ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
showmessage('Im a Clickevent');
end;

procedure TForm2.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.State=cbUnchecked then Chart1.View3D:=false else Chart1.View3D:=true;
end;

end.
And here the "dfm"

Code: Select all

object Form2: TForm2

  Left = 0

  Top = 0

  Caption = 'Form2'

  ClientHeight = 479

  ClientWidth = 692

  Color = clBtnFace

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'Tahoma'

  Font.Style = []

  OldCreateOrder = False

  PixelsPerInch = 96

  TextHeight = 13

  object Chart1: TChart

    Left = 0

    Top = 0

    Width = 692

    Height = 438

    BackWall.Brush.Gradient.Direction = gdBottomTop

    BackWall.Brush.Gradient.EndColor = clWhite

    BackWall.Brush.Gradient.StartColor = 15395562

    BackWall.Brush.Gradient.Visible = True

    BackWall.Gradient.Direction = gdBottomTop

    BackWall.Gradient.EndColor = clWhite

    BackWall.Gradient.StartColor = 15395562

    BackWall.Gradient.Visible = True

    BackWall.Transparent = False

    Foot.Font.Name = 'Verdana'

    Gradient.Direction = gdBottomTop

    Gradient.EndColor = clWhite

    Gradient.MidColor = 15395562

    Gradient.StartColor = 15395562

    Gradient.Visible = True

    LeftWall.Color = 14745599

    Legend.Font.Name = 'Verdana'

    Legend.MaxNumRows = 0

    RightWall.Color = 14745599

    SubFoot.Font.Name = 'Verdana'

    SubTitle.Font.Name = 'Verdana'

    Title.Font.Name = 'Verdana'

    Title.Text.Strings = (

      'TChart')

    OnClickSeries = Chart1ClickSeries

    BottomAxis.Axis.Color = 4210752

    BottomAxis.Grid.Color = 11119017

    BottomAxis.LabelsFont.Name = 'Verdana'

    BottomAxis.MaximumOffset = 5

    BottomAxis.MinimumOffset = 5

    BottomAxis.TicksInner.Color = 11119017

    BottomAxis.Title.Font.Name = 'Verdana'

    DepthAxis.Axis.Color = 4210752

    DepthAxis.Grid.Color = 11119017

    DepthAxis.LabelsFont.Name = 'Verdana'

    DepthAxis.TicksInner.Color = 11119017

    DepthAxis.Title.Font.Name = 'Verdana'

    DepthTopAxis.Axis.Color = 4210752

    DepthTopAxis.Grid.Color = 11119017

    DepthTopAxis.LabelsFont.Name = 'Verdana'

    DepthTopAxis.TicksInner.Color = 11119017

    DepthTopAxis.Title.Font.Name = 'Verdana'

    LeftAxis.Axis.Color = 4210752

    LeftAxis.Grid.Color = 11119017

    LeftAxis.LabelsFont.Name = 'Verdana'

    LeftAxis.MaximumOffset = 5

    LeftAxis.MinimumOffset = 5

    LeftAxis.TicksInner.Color = 11119017

    LeftAxis.Title.Font.Name = 'Verdana'

    RightAxis.Axis.Color = 4210752

    RightAxis.Grid.Color = 11119017

    RightAxis.LabelsFont.Name = 'Verdana'

    RightAxis.TicksInner.Color = 11119017

    RightAxis.Title.Font.Name = 'Verdana'

    TopAxis.Axis.Color = 4210752

    TopAxis.Grid.Color = 11119017

    TopAxis.LabelsFont.Name = 'Verdana'

    TopAxis.TicksInner.Color = 11119017

    TopAxis.Title.Font.Name = 'Verdana'

    Align = alClient

    TabOrder = 0

    ExplicitTop = 2

    ColorPaletteIndex = 13

  end

  object Panel1: TPanel

    Left = 0

    Top = 438

    Width = 692

    Height = 41

    Align = alBottom

    Caption = 'Panel1'

    TabOrder = 1

    ExplicitLeft = 508

    ExplicitTop = 444

    ExplicitWidth = 185

    object Button1: TButton

      Left = 300

      Top = 8

      Width = 75

      Height = 25

      Caption = 'Init'

      TabOrder = 0

      OnClick = Button1Click

    end

    object CheckBox1: TCheckBox

      Left = 460

      Top = 12

      Width = 97

      Height = 17

      Caption = '3D'

      TabOrder = 1

      OnClick = CheckBox1Click

    end

  end

end


Michael
Newbie
Newbie
Posts: 6
Joined: Fri Jul 23, 2010 12:00 am

Re: tchart->onclickseries for tpointseries -> no action

Post by Michael » Thu Jul 29, 2010 8:20 am

Hello,
they could reproduce the errors with the clickseriesevent already? Or they need more information?
regards

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: tchart->onclickseries for tpointseries -> no action

Post by Yeray » Thu Jul 29, 2010 9:42 am

Hi Michael,

You are right. For some reason the Chart event OnClickSeries doesn't seem to work with TPointSeries. I've added it to the defect list to be fixed in future releases (TV52015058).
However, you could try with the OnMouseDown event:

Code: Select all

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
  var i: Integer;
begin
  for i:=0 to Chart1.SeriesCount-1 do
    if (Chart1[i].Clicked(X,Y) > -1) then
      showmessage('MouseDown event, series clicked: ' + IntToStr(i));
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

sajtab
Newbie
Newbie
Posts: 6
Joined: Thu Aug 26, 2010 12:00 am

Re: tchart->onclickseries for tpointseries -> no action

Post by sajtab » Fri Oct 22, 2010 12:17 am

Hi,

I have also seen a similar problem with TLineSeries when the series is a straight horizontal line. I am using TeeChart Standard V9, 2010.

Sajjad

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: tchart->onclickseries for tpointseries -> no action

Post by Narcís » Fri Oct 22, 2010 3:04 pm

Hello Michael and Sajjad,

Both issues works fine for me here using our latest sources and code snippet below. Are you using v2010.01.11004 which is the latest version available at the client area?

Code: Select all

uses Series;

procedure TForm1.Chart1ClickSeries(Sender: TCustomChart;
  Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  ShowMessage('Series clicked');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=False;

//  Chart1.AddSeries(TPointSeries.Create(Self));
  Chart1.AddSeries(TLineSeries.Create(Self));
  Chart1[0].Add(10);
  Chart1[0].Add(10);
end;
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

sajtab
Newbie
Newbie
Posts: 6
Joined: Thu Aug 26, 2010 12:00 am

Re: tchart->onclickseries for tpointseries -> no action

Post by sajtab » Fri Oct 22, 2010 5:20 pm

Hi Narcis,

I have been using TeeChart Standard v2010.00.00407 and haven't tried the latest.

Thanks,

Sajjad

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: tchart->onclickseries for tpointseries -> no action

Post by Narcís » Mon Oct 25, 2010 7:05 am

Hi Sajjad,

Can you please try if latest release solves the issue at your end?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply