mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-01 22:23:39 +02:00
TAChart: Series clipping bugfixes and partially implement TSeriesPointer from Luis Rodrigues (issue #8706)
git-svn-id: trunk@10959 -
This commit is contained in:
parent
6b97b84226
commit
9e0cbc1e29
@ -43,7 +43,7 @@ Installation
|
|||||||
|
|
||||||
Changes
|
Changes
|
||||||
-------
|
-------
|
||||||
|
* 17/04/2007 - Series clipping bugfixes and partially implement TSeriesPointer
|
||||||
* 12/03/2007 - Bugfixes and implement ShowInLegend
|
* 12/03/2007 - Bugfixes and implement ShowInLegend
|
||||||
* 01/01/2007 - Initial Release
|
* 01/01/2007 - Initial Release
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||||
TAGraph, TASeries, Buttons, StdCtrls;
|
TAGraph, TASeries, Buttons, StdCtrls, TAEngine;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ begin
|
|||||||
Chart1.AddSerie(p);
|
Chart1.AddSerie(p);
|
||||||
p.title := 'pie';
|
p.title := 'pie';
|
||||||
p.SeriesColor := clRed;
|
p.SeriesColor := clRed;
|
||||||
p.MarksStyle := taseries.smsLabelPercent;
|
p.MarksStyle := taengine.smsLabelPercent;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ begin
|
|||||||
d:= TSerie.Create(Chart1);
|
d:= TSerie.Create(Chart1);
|
||||||
d.ShowLines := true;
|
d.ShowLines := true;
|
||||||
d.ShowPoints := true;
|
d.ShowPoints := true;
|
||||||
d.PointStyle := taseries.psRectangle;
|
d.Pointer.Style := psRectangle;
|
||||||
d.title := 'line';
|
d.title := 'line';
|
||||||
d.SeriesColor := clRed;
|
d.SeriesColor := clRed;
|
||||||
Chart1.AddSerie(d);
|
Chart1.AddSerie(d);
|
||||||
|
@ -76,7 +76,7 @@ type
|
|||||||
procedure Assign(Source:TPersistent); override;
|
procedure Assign(Source:TPersistent); override;
|
||||||
published
|
published
|
||||||
property Visible: boolean read FVisible write SetVisible;
|
property Visible: boolean read FVisible write SetVisible;
|
||||||
property OnChange: TNotifyEvent read FChanged write FChanged;
|
property OnChange: TNotifyEvent read FChanged write FChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TLegendAlignment=(laLeft,laRight,laTop,laBottom);
|
TLegendAlignment=(laLeft,laRight,laTop,laBottom);
|
||||||
@ -1384,7 +1384,7 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
Series.Add(Serie);
|
Series.Add(Serie);
|
||||||
TChartSeries(Serie).Chart := Self;
|
TChartSeries(Serie).ParentChart := Self;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//procedure TChart.DeleteSerie(Serie:TSerie);
|
//procedure TChart.DeleteSerie(Serie:TSerie);
|
||||||
@ -1556,6 +1556,7 @@ Clean;
|
|||||||
DrawAxis;
|
DrawAxis;
|
||||||
DisplaySeries;
|
DisplaySeries;
|
||||||
DrawTitleFoot;
|
DrawTitleFoot;
|
||||||
|
|
||||||
if FLegend.Visible then DrawLegend;
|
if FLegend.Visible then DrawLegend;
|
||||||
|
|
||||||
if FShowVerticalReticule then
|
if FShowVerticalReticule then
|
||||||
@ -1600,7 +1601,19 @@ procedure TChart.DisplaySeries;
|
|||||||
var
|
var
|
||||||
i:Integer;
|
i:Integer;
|
||||||
Serie:TChartSeries;
|
Serie:TChartSeries;
|
||||||
|
Rgn : HRGN;
|
||||||
|
p: array[0..1] of TPoint;
|
||||||
begin
|
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
|
// Update all series
|
||||||
for i:=0 to FSeries.Count-1 do begin
|
for i:=0 to FSeries.Count-1 do begin
|
||||||
Serie:= TChartSeries( Series[i] );
|
Serie:= TChartSeries( Series[i] );
|
||||||
@ -2028,7 +2041,7 @@ end;
|
|||||||
|
|
||||||
{$IFDEF fpc}
|
{$IFDEF fpc}
|
||||||
initialization
|
initialization
|
||||||
{$I tagraph.lrs}
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user