mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 18:00:26 +02:00
TAChart: Add legend drawing for TOpenHighLowCloseSeries
git-svn-id: trunk@29889 -
This commit is contained in:
parent
35d67957cf
commit
a498bbde25
@ -153,6 +153,30 @@ implementation
|
||||
uses
|
||||
Math, SysUtils, TAGeometry, TAGraph;
|
||||
|
||||
type
|
||||
|
||||
{ TLegendItemOHLCLine }
|
||||
|
||||
TLegendItemOHLCLine = class(TLegendItemLine)
|
||||
public
|
||||
procedure Draw(ADrawer: IChartDrawer; const ARect: TRect); override;
|
||||
end;
|
||||
|
||||
{ TLegendItemOHLCLine }
|
||||
|
||||
procedure TLegendItemOHLCLine.Draw(ADrawer: IChartDrawer; const ARect: TRect);
|
||||
var
|
||||
dx, x, y: Integer;
|
||||
begin
|
||||
inherited Draw(ADrawer, ARect);
|
||||
y := (ARect.Top + ARect.Bottom) div 2;
|
||||
dx := (ARect.Right - ARect.Left) div 3;
|
||||
x := ARect.Left + dx;
|
||||
ADrawer.Line(x, y, x, y + 2);
|
||||
x += dx;
|
||||
ADrawer.Line(x, y, x, y - 2);
|
||||
end;
|
||||
|
||||
{ TBubbleSeries }
|
||||
|
||||
procedure TBubbleSeries.Assign(ASource: TPersistent);
|
||||
@ -516,7 +540,7 @@ end;
|
||||
|
||||
procedure TOpenHighLowCloseSeries.GetLegendItems(AItems: TChartLegendItems);
|
||||
begin
|
||||
//
|
||||
AItems.Add(TLegendItemOHLCLine.Create(LinePen, Title));
|
||||
end;
|
||||
|
||||
function TOpenHighLowCloseSeries.GetSeriesColor: TColor;
|
||||
|
Loading…
Reference in New Issue
Block a user