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 756

Summary: Multiple Legends demo doesn't work well from v2014.10
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: LegendAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: enhancement CC: boris.seve
Priority: ---    
Version: 140220   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://www.teechart.net/support/viewtopic.php?p=65915#p65915
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2014-04-30 06:15:59 EDT
Lots of changes were made in the Legend drawing between v2013.09 and v2014.10.
These changes make the example at "All features\Welcome\Miscellaneous\Legend\Multiple Legends" in the features demo to draw a strange Legend Rectangle for the second legend. See the image the customer attached in the forums.

I've seen this is because the ShapeBounds needs to be recalculated after assigning a new Series to the legend.

This could be related to http://bugs.teechart.net/show_bug.cgi?id=755
Comment 1 yeray alonso 2014-04-30 06:17:49 EDT
Can be fixed making TCustomChartLegend.CalcRect public and calling it in the AfterDraw event in the demo, after assigning Series2 and before DrawLegend:

  if CheckBox1.Checked then
  With Chart1.Legend do
  begin
    Top:=125;
    Series:=Series2;
    CalcRect;
    DrawLegend;
    CustomPosition:=False;
    Series:=Series1;
  end;