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 1759

Summary: Abnormal Crash in TeeChart - using "Other Slice" value
Product: VCL TeeChart Reporter: Bradley MacDonald <brad>
Component: ChartAssignee: yeray alonso <yeray>
Status: RESOLVED FIXED    
Severity: major CC: brad, yeray
Priority: ---    
Version: 20.170306   
Target Milestone: v2017.20   
Hardware: PC   
OS: Windows   
Chart Series: Pie Delphi / C++ Builder RAD IDE Version: RAD 10.1 Berlin
Attachments: Sample Project - TeeChart Crash on Mouse Over

Description Bradley MacDonald 2017-01-25 22:34:44 EST
Hello

Attached is a project that will show you the crash we have encountered.  It happens EVERY time!!   

If you have a pie chart - and add values to it - then setup the 'other' slice option in the graph - it will crash every time you move the mouse over the pie in the graph.

If you run the application - then choose Load Values button - it will display the graph very nicely.   Now - if you move the mouse over the pie in the graph - it will crash (and not in a nice way :))  

My guess is that it is a combination of the Other slice being set - and the highlighting of the pie slice you are over.  But I am not sure...    

The error message is something along the lines of 
" Project X raised exception class ChartException with message 'Series Delete: ValueIndex 8 out of bounds (0 to 7)."

**** There are 8 values in the graph (in this example). So - yes - the value is out of bounds :) 

Please let me know if I can provide any other information - but I think the attached project should enable you to duplicate the issue right away.

Bradley MacDonald
brad@timeacct.com
Delphi XE10.1
Windows 7 SP1
Comment 1 yeray alonso 2017-02-02 02:23:34 EST
I can't see the attachment, could you please try to upload it again?
Comment 2 Bradley MacDonald 2017-02-02 11:34:03 EST
Created attachment 705 [details]
Sample Project - TeeChart Crash on Mouse Over

You can also download it from www.timeacct.com/files/TeeChartIssue.zip.  This download contains the compiled program as well as the source.   It demonstrates the issue every time.  

Let me know if you have any problems getting the sample project.
Comment 3 yeray alonso 2017-02-03 09:45:04 EST
I can reproduce the problem with the given application. Thanks for attaching it, Bradley.

It seems the problem happens when the series is repainted.

If you aren't interested on the Hover feature, you can disable it and the chart won't be repainted when you move the mouse over it:

    Chart_Dir.Hover.Visible:=False;
Comment 4 Bradley MacDonald 2017-02-03 11:53:18 EST
Yeray 

Thank you for the update.  I am glad you can reproduce it - and it was not just me :)

Thank you for the work around - and I will look forward to the patch when it is available.

Bradley
Comment 5 yeray alonso 2017-02-08 02:40:04 EST
We have a fix proposal pending to investigate if it causes any collateral damage.
Feel free to test it for your purposes.

It consists on three small modifications at TeEngine.pas:

- At ´RefreshLinked´ procedure, nested inside ´TChartSeries.NotifyValue´, substitute this:

      veDelete : if rOnDelete in FRecalcOptions then
                    if FunctionType=nil then
                       DeletedValue(Self,ValueIndex);

for this:

      veDelete : if rOnDelete in FRecalcOptions then
                    if (FunctionType=nil) and (ValueIndex<Count) then
                       DeletedValue(Self,ValueIndex);

- At the end of ´TChartSeries.AddXY´ function, remove these lines:

    if IUpdating=0 then
       NotifyNewValue(Self,result);

- At the end of ´TLabelsList.InsertLabel´ procedure, add this line:

  Series.NotifyValue(veModify,ValueIndex);
Comment 6 Bradley MacDonald 2017-02-13 16:02:37 EST
Hello Yeray,



There are two places where there is a TEEngine.pas file. 


C:\Delphi\Components\TeeChartPro\Source
and
C:\Delphi\Components\TeeChartPro\Source\VCL

which one should I modify for testing?  
I also noted that the path (library) is set to (C:\Delphi\Components\TeeChartPro\Compiled\Delphi24.win32\Lib).  What is the best way to get the DCU into that directory?  Just copy it?  Or is there a specific process I should follow?

Bradley
Comment 7 yeray alonso 2017-02-14 04:29:43 EST
We ended implementing a different approach, consisting on incrementing and decrementing IUpdating variable to prevent propagating the changes in the middle of the repaint process.

At Series.pas unit:

line 10490:

    Inc(IUpdating);
    Delete(t);
    Dec(IUpdating);

line 10566:

  Inc(IUpdating);
  XValues.FillSequence;
  Dec(IUpdating);

line 10595:

      Inc(IUpdating);
      t:=AddXY(TeePieOtherFlag,tmpValue,FOtherSlice.Text,FOtherSlice.Color);
      Dec(IUpdating);

The recommended way to modify the sources is to modify the files at the "Source" folder and run "TeeRecompile.exe" utility to generate both the sources in the "VCL" / "FMX" folders, and the binaries in the "Compiled" folders.
Comment 8 Bradley MacDonald 2017-02-14 10:27:17 EST
Thank you very much for the update and the notes about the proper way to compile the changes!