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 946 - OnClickSeries event in TChart with TBoxSeries is not always fired and sometimes with the wrong Series parameter
Summary: OnClickSeries event in TChart with TBoxSeries is not always fired and sometim...
Status: RESOLVED INVALID
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Chart (show other bugs)
Version: 32.210430
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-07 01:54 EDT by Stefan Bieringer
Modified: 2021-09-15 05:54 EDT (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Bieringer 2014-10-07 01:54:41 EDT
Goal:
Show the title of a series on a label when the user clicked on a box.
IDE: Delphi XE3

The OnClickSeries event in the TChart component with TBoxSeries is not always fired and sometimes with the wrong "Series" parameter.

When the following code is executed and we click on the boxes some different effects can be observed:
- Label get the right title
- Event is not triggered (please have a look to the time signature at the lable.caption)
- Lebel get the wrong title
- Same series get different result at different clicks

Please click between different boxes.


Code to reproduces
Add a TChart, a Button and a Label on a VCL-Form without any property changes

Fill two events with following code:


// Create some boxplots and fill them with values
procedure TForm1.Button1Click(Sender: TObject);
var
  NewBoxSerie: TBoxSeries;
  i: Integer;
  w: Double;
  x: Integer;
  j: Integer;
  xSeriesCount: Integer;
begin

  Chart1.SeriesList.Clear;
  Chart1.Legend.Items.Clear;


  xSeriesCount:=5;

  // Calculate the distance between the box plots
  w:=100 / (xSeriesCount + 1);

  for i := 0 to xSeriesCount - 1 do
  begin

    NewBoxSerie:=TBoxSeries.Create(Chart1);

    // Create some nice box plot values
    NewBoxSerie.AddX(1);
    NewBoxSerie.AddX(2);

    NewBoxSerie.AddX(10);
    NewBoxSerie.AddX(12);
    NewBoxSerie.AddX(13);
    NewBoxSerie.AddX(14);
    NewBoxSerie.AddX(15);

    NewBoxSerie.AddX(25);
    NewBoxSerie.AddX(26);

    NewBoxSerie.Title:=IntToStr(Chart1.SeriesCount);
    Chart1.AddSeries(NewBoxSerie);

    // Set the position of the box plot for better viewing
    NewBoxSerie.Position:=(w / 2) + (w * i);
    NewBoxSerie.Box.Color:=NewBoxSerie.Color;

  end;


end;


// Show the user the title of the clicked series 
procedure TForm1.Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries;
  ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin

  if Assigned(Series) then

    Label1.Caption:='Clicked on series ' + Series.Title +
                    // Added the time stamp to see that the event is not always triggered
                    ' at: ' + FormatDateTime('NN:SS', Now)
  else
    Label1.Caption:='Series not assigned';

end;
Comment 1 Stefan Bieringer 2020-01-28 02:13:47 EST
The bug still exists in Build 2020.29.200113 with Delphi Rio 10.3.3

The Boxplot feature is coming up to be more and more important for the software product!
Comment 2 marc meumann 2021-09-14 03:16:59 EDT
Not reproducible with latest build: 2021.32.210430.
Comment 3 Stefan Bieringer 2021-09-15 03:29:00 EDT
The bug still exists in TeeChart Pro v2021.32.210430 with Delphi RAD Studio 10.4 Update 2.
Click around on different box series and your will see that the label will not always show the correct series number.

What I have done:
Uninstall all previous versions of "Steema TeeChart Pro"
Delete all directories under "C:\Program Files (x86)\Steema Software\"
Delete all settings in the Delphi option page (library and source pathes, etc.) that are linked to previous version.
Download the latest version "TeeChart Pro v2021.32.210430"
Install the latest version.

Open the project and do the test.
Click the button to create some box series.
Click in the colored area of different series and see what will be reported by the "Chart1ClickSeries" event to the label.

The label will not show always the correct clicked series title.
Comment 4 marc meumann 2021-09-15 05:21:37 EDT
This issue continues to evade our tests. Please confirm that the Chart is setup 2D, ie. Chart1.View3D := False, as the BoxSeries is not well suited to 3D for click-response.
Comment 5 Stefan Bieringer 2021-09-15 05:54:17 EDT
> Chart1.View3D := False
That's it!

Thanks a lot for this "workaround" that helps so much for discussions to my customers and provide a "solution".

> as the BoxSeries is not well suited to 3D for click-response.
Would be cool to get fixed this anyway to give my customers the experience they like...