Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 305 - [TV52015700] The Clicked method doesn't seem to work fine with Bar series and 3D: ...
Summary: [TV52015700] The Clicked method doesn't seem to work fine with Bar series and...
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: All All
: High major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-17 12:44 EDT by yeray alonso
Modified: 2014-03-19 14:01 EDT (History)
2 users (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
Project with non-orthogonal 3D chart showing the problem. (57.62 KB, application/x-zip-compressed)
2014-03-14 08:34 EDT, narcís calvet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2013-11-20 10:37:30 EST
The Clicked method doesn't seem to work fine with Bar series and 3D:
It worked a litle bit better in v6 (see the attachments)
Probably related to TV52014246.
It happens in .NET too.
procedure TForm1.FormCreate(Sender: TObject);
var i, j: Integer;
    s: TBarSeries;
begin
    Chart1.Align:=alClient;
    Chart1.View3DOptions.Orthogonal:=false;
    Chart1.DepthAxis.Automatic:=false;
    Chart1.DepthAxis.Maximum:=8;
    Chart1.DepthAxis.Minimum:=-0.5 ;
    Chart1.DepthAxis.Visible:=true;
    Chart1.DepthAxis.Increment:=100;
    Chart1.View3DOptions.Rotation:=350;
    Chart1.View3DOptions.Elevation:=355;
    Chart1.View3DOptions.Zoom:=85;
    for i:=1 to 9 do
    begin
        s:=TBarSeries.Create(Chart1);
        s.ParentChart:=Chart1;
        s.Title:='Y' + IntToStr(i-1);
        s.MultiBar:=mbNone;
        s.ZOrder:=(i * 4) - 1;
        for j:=0 to 3 do
          s.Add(1000-i*80);
    end;
end;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var SeriesIndex, ValueIndex: Integer;
begin
  for SeriesIndex:=0 to Chart1.SeriesCount-1 do
  begin
    ValueIndex:=Chart1[SeriesIndex].Clicked(X,Y);
    if ValueIndex>-1 then
      Break;
  end;
  if ValueIndex>-1 then
    Chart1.Title.Text.Text:='Series: '+IntToStr(SeriesIndex)+', ValueIndex: '+IntToStr(ValueIndex)
  else
    Chart1.Title.Text.Text:='Background';
end; [created:2011-08-17T11:44:02.000+01:00 reported by:yeray@steema.com reported in version:2011.03.30407 (TeeChart VCL)]
Comment 1 narcís calvet 2014-03-14 08:34:40 EDT
Created attachment 116 [details]
Project with non-orthogonal 3D chart showing the problem.
Comment 2 david berneda 2014-03-19 13:31:49 EDT
Yes. 3D is not being considered.
There is no "ClickedCube" function yet that can be used by Bar series in 3D.
Comment 3 david berneda 2014-03-19 14:01:56 EDT
Fixed. 
Implemented TCustomBarSeries.PointInCube valid for both Bar and HorizBar series.
The fix should also work fine in 3D Orthogonal mode.

Also added new TCanvas3D.CubeHull function that returns the polygon boundaries for a given rectangle and Z0,Z1.

In the attached example, this code will show the correct Series and ValueIndex:

var tmp : String;

  tmp:=GetEnumName(TypeInfo(TChartClickedPartStyle), Integer(Part.Part));

  if Assigned(Part.ASeries) then
     tmp:=tmp+' '+SeriesTitleOrName(Part.ASeries)+' '+IntToStr(Part.PointIndex);

  Memo1.Lines.Add(tmp);