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 856

Summary: CalcXPosValue after DrawToMetaCanvas isn’t work correctly.
Product: VCL TeeChart Reporter: sandra pazos <sandra>
Component: CanvasAssignee: Steema Issue Manager <issuemanager>
Status: CONFIRMED ---    
Severity: normal CC: david.novo
Priority: High    
Version: 140512   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description sandra pazos 2014-07-21 04:30:20 EDT
CalcXPosValue after DrawToMetaCanvas isn't work correctly. The following code generates a different value the first and second time you call CalcXPos if a DrawToMetaCanvas is in the middle. This is because DrawToMetaCanvas resets the StartPos and EndPos of the axes and it is never set back

procedure TForm1.Button1Click(Sender: TObject);
var
  mf:TMetafile;
  mfc:TMetafileCanvas;
begin
  series1.AddXY(5,5);
  series1.AddXY(15,15);
  series1.AddXY(25,25);
  mf:=TMetafile.Create;
  mf.Width:=1000;
  mf.Height:=1000;
  mfc:=TMetafileCanvas.Create(mf,0);
   showMessage(chart1.LeftAxis.CalcXPosValue(15).toString);
  chart1.DrawToMetaCanvas(mfc,rect(0,0,1000,1000));
  mfc.Free;
  mf.Free;
  showMessage(chart1.LeftAxis.CalcXPosValue(15).toString);
end;