TAChart: Series clipping bugfixes and partially implement TSeriesPointer from Luis Rodrigues (issue #8706)

git-svn-id: trunk@10959 -
This commit is contained in:
vincents 2007-04-17 14:43:02 +00:00
parent 6b97b84226
commit 9e0cbc1e29
4 changed files with 363 additions and 266 deletions

View File

@ -43,7 +43,7 @@ Installation
Changes
-------
* 17/04/2007 - Series clipping bugfixes and partially implement TSeriesPointer
* 12/03/2007 - Bugfixes and implement ShowInLegend
* 01/01/2007 - Initial Release

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
TAGraph, TASeries, Buttons, StdCtrls;
TAGraph, TASeries, Buttons, StdCtrls, TAEngine;
type
@ -83,7 +83,7 @@ begin
Chart1.AddSerie(p);
p.title := 'pie';
p.SeriesColor := clRed;
p.MarksStyle := taseries.smsLabelPercent;
p.MarksStyle := taengine.smsLabelPercent;
end;
@ -92,7 +92,7 @@ begin
d:= TSerie.Create(Chart1);
d.ShowLines := true;
d.ShowPoints := true;
d.PointStyle := taseries.psRectangle;
d.Pointer.Style := psRectangle;
d.title := 'line';
d.SeriesColor := clRed;
Chart1.AddSerie(d);

View File

@ -76,7 +76,7 @@ type
procedure Assign(Source:TPersistent); override;
published
property Visible: boolean read FVisible write SetVisible;
property OnChange: TNotifyEvent read FChanged write FChanged;
property OnChange: TNotifyEvent read FChanged write FChanged;
end;
TLegendAlignment=(laLeft,laRight,laTop,laBottom);
@ -1384,7 +1384,7 @@ end;
Series.Add(Serie);
TChartSeries(Serie).Chart := Self;
TChartSeries(Serie).ParentChart := Self;
end;
//procedure TChart.DeleteSerie(Serie:TSerie);
@ -1556,6 +1556,7 @@ Clean;
DrawAxis;
DisplaySeries;
DrawTitleFoot;
if FLegend.Visible then DrawLegend;
if FShowVerticalReticule then
@ -1600,7 +1601,19 @@ procedure TChart.DisplaySeries;
var
i:Integer;
Serie:TChartSeries;
Rgn : HRGN;
p: array[0..1] of TPoint;
begin
//set cliping region
p[0].x := XImageMin;
p[0].y := YImageMax;
p[1].x := XImageMax;
p[1].y := YImageMin;
// LPtoDP(Canvas.Handle, p, 2);
Rgn := CreateRectRgn(p[0].x, p[0].y, p[1].x, p[1].y);
SelectClipRgn (Canvas.Handle, Rgn);
// Update all series
for i:=0 to FSeries.Count-1 do begin
Serie:= TChartSeries( Series[i] );
@ -2028,7 +2041,7 @@ end;
{$IFDEF fpc}
initialization
{$I tagraph.lrs}
{$ENDIF}

File diff suppressed because it is too large Load Diff