TAChart: Chart drawers support setting pen width.

git-svn-id: trunk@64380 -
This commit is contained in:
wp 2021-01-12 16:44:38 +00:00
parent 68f758f8e2
commit 227b974139
8 changed files with 71 additions and 15 deletions

View File

@ -65,7 +65,8 @@ type
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
end;
implementation
@ -293,13 +294,20 @@ begin
ApplyTransparency(ChartColorToFPColor(ColorOrMono(AColor)));
end;
procedure TAggPasDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure TAggPasDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor;
AWidth: Integer = 1);
begin
FCanvas.Pen.Style := AStyle;
FCanvas.Pen.Width := AWidth;
FCanvas.Pen.FPColor :=
ApplyTransparency(ChartColorToFPColor(ColorOrMono(AColor)));
end;
procedure TAggpasDrawer.SetPenWidth(AWidth: Integer);
begin
FCanvas.Pen.Width := AWidth;
end;
function TAggPasDrawer.SimpleTextExtent(const AText: String): TPoint;
begin
Result := FCanvas.TextExtent(AText);

View File

@ -69,7 +69,8 @@ type
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
procedure SetTransparency(ATransparency: TChartTransparency);
end;
@ -318,13 +319,19 @@ begin
end;
procedure TBGRABitmapDrawer.SetPenParams(
AStyle: TFPPenStyle; AColor: TChartColor);
AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
begin
Canvas.Pen.Style := AStyle;
Canvas.Pen.Width := AWidth;
Canvas.Pen.Color := ColorOrMono(AColor);
Canvas.Pen.Opacity := Opacity;
end;
procedure TBGRABitmapDrawer.SetPenWidth(AWidth: Integer);
begin
Canvas.Pen.Width := AWidth;
end;
procedure TBGRABitmapDrawer.SetTransparency(ATransparency: TChartTransparency);
begin
inherited;

View File

@ -80,7 +80,9 @@ type
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
end experimental;
implementation
@ -427,12 +429,18 @@ begin
end;
procedure TFPVectorialDrawer.SetPenParams(
AStyle: TFPPenStyle; AColor: TChartColor);
AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
begin
FPenStyle := AStyle;
FPenWidth := AWidth;
FPenColor := FChartColorToFPColorFunc(AColor);
end;
procedure TFPVectorialDrawer.SetPenWidth(AWidth: Integer);
begin
FPenWidth := AWidth;
end;
function TFPVectorialDrawer.SimpleTextExtent(const AText: String): TPoint;
begin
if FFTFont <> nil then

View File

@ -88,7 +88,8 @@ type
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
procedure SetTransparency(ATransparency: TChartTransparency);
end;
@ -424,13 +425,20 @@ begin
FPenColor := FChartColorToFPColorFunc(AColor);
end;
procedure TOpenGLDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure TOpenGLDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor;
AWidth: Integer = 1);
begin
FPenStyle := AStyle;
FPenWidth := AWidth;
FPenColor := FChartColorToFPColorFunc(AColor);
ChartGLPenStyle(AStyle);
end;
procedure TOpenGLDrawer.SetPenWidth(AWidth: Integer);
begin
FPenWidth := AWidth;
end;
procedure TOpenGLDrawer.SetTransparency(ATransparency: TChartTransparency);
begin
inherited;

View File

@ -76,7 +76,8 @@ type
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
procedure SetTransparency(ATransparency: TChartTransparency);
end;
@ -430,13 +431,20 @@ begin
GetCanvas.Pen.Color := ColorOrMono(AColor);
end;
procedure TCanvasDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure TCanvasDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor;
AWidth: Integer = 1);
begin
GetCanvas.Pen.Style := AStyle;
GetCanvas.Pen.Width := AWidth;
if not FXor then
GetCanvas.Pen.Color := ColorOrMono(AColor);
end;
procedure TCanvasDrawer.SetPenWidth(AWidth: Integer);
begin
GetCanvas.Pen.Width := AWidth;
end;
procedure TCanvasDrawer.SetTransparency(ATransparency: TChartTransparency);
function FillAlpha(AAlpha: Byte): Byte;

View File

@ -78,7 +78,8 @@ type
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
end;
implementation
@ -336,10 +337,17 @@ begin
FCanvas.Pen.FPColor := FChartColorToFPColorFunc(AColor);
end;
procedure TFPCanvasDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure TFPCanvasDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor;
AWidth: Integer = 1);
begin
FCanvas.Pen.Style := AStyle;
FCanvas.Pen.FPColor := FChartColorToFPColorFunc(AColor);
FCanvas.Pen.Width := AWidth;
end;
procedure TFPCanvasDrawer.SetPenWidth(AWidth: Integer);
begin
FCanvas.Pen.Width := AWidth;
end;
function TFPCanvasDrawer.SimpleTextExtent(const AText: String): TPoint;

View File

@ -90,7 +90,8 @@ type
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
end;
@ -515,10 +516,17 @@ begin
FPen.FPColor := FChartColorToFPColorFunc(ColorOrMono(AColor));
end;
procedure TSVGDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure TSVGDrawer.SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor;
AWidth: Integer = 1);
begin
FPen.FPColor := FChartColorToFPColorFunc(ColorOrMono(AColor));
FPen.Style := AStyle;
FPen.Width := AWidth;
end;
procedure TSVGDrawer.SetPenWidth(AWidth: Integer);
begin
FPen.Width := AWidth;
end;
function TSVGDrawer.SimpleTextExtent(const AText: String): TPoint;

View File

@ -114,7 +114,8 @@ type
procedure SetMonochromeColor(AColor: TChartColor);
procedure SetPen(APen: TFPCustomPen);
procedure SetPenColor(AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor; AWidth: Integer = 1);
procedure SetPenWidth(AWidth: Integer);
function GetRightToLeft: Boolean;
procedure SetRightToLeft(AValue: Boolean);
procedure SetTransparency(ATransparency: TChartTransparency);