diff --git a/components/tachart/demo/fpvectorial/Main.lfm b/components/tachart/demo/fpvectorial/Main.lfm index 0619288510..910bfa3c85 100644 --- a/components/tachart/demo/fpvectorial/Main.lfm +++ b/components/tachart/demo/fpvectorial/Main.lfm @@ -33,6 +33,10 @@ object Form1: TForm1 LinePen.Color = clFuchsia Source = RandomChartSource1 end + object Chart1BarSeries1: TBarSeries + BarBrush.Color = clRed + Source = RandomChartSource1 + end end object Panel1: TPanel Left = 0 diff --git a/components/tachart/demo/fpvectorial/Main.pas b/components/tachart/demo/fpvectorial/Main.pas index 64b893dd72..6502850f7a 100644 --- a/components/tachart/demo/fpvectorial/Main.pas +++ b/components/tachart/demo/fpvectorial/Main.pas @@ -18,6 +18,7 @@ type btnSVG: TButton; btnGCode: TButton; Chart1: TChart; + Chart1BarSeries1: TBarSeries; Chart1LineSeries1: TLineSeries; Panel1: TPanel; RandomChartSource1: TRandomChartSource; diff --git a/components/tachart/tadrawerfpvectorial.pas b/components/tachart/tadrawerfpvectorial.pas index a40074c751..b1a3a4b69a 100644 --- a/components/tachart/tadrawerfpvectorial.pas +++ b/components/tachart/tadrawerfpvectorial.pas @@ -124,7 +124,14 @@ end; procedure TFPVectorialDrawer.FillRect(AX1, AY1, AX2, AY2: Integer); begin - // Not implemented. + MoveTo(AX1, AY1); + FCanvas.AddLineToPath(AX2, AY1); + FCanvas.AddLineToPath(AX2, AY2); + FCanvas.AddLineToPath(AX1, AY2); + FCanvas.AddLineToPath(AX1, AY1); + FCanvas.SetBrushStyle(bsClear); + FCanvas.SetPenColor(FPenColor); + FCanvas.EndPath(); end; function TFPVectorialDrawer.GetBrushColor: TChartColor; @@ -140,7 +147,8 @@ end; procedure TFPVectorialDrawer.Line(AX1, AY1, AX2, AY2: Integer); begin FCanvas.StartPath(AX1, AY1); - FCanvas.AddLineToPath(AX2, AY2, FPenColor); + FCanvas.AddLineToPath(AX2, AY2); + FCanvas.SetPenColor(FPenColor); FCanvas.EndPath(); end; @@ -162,9 +170,16 @@ end; procedure TFPVectorialDrawer.Polygon( const APoints: array of TPoint; AStartIndex, ANumPts: Integer); +var + i: Integer; begin - // Not implemented. - Polyline(APoints, AStartIndex, ANumPts); + MoveTo(APoints[AStartIndex]); + for i := 1 to ANumPts - 1 do + with APoints[i + AStartIndex] do + FCanvas.AddLineToPath(X, Y); + FCanvas.SetBrushColor(FBrushColor); + FCanvas.SetPenColor(FPenColor); + FCanvas.EndPath(); end; procedure TFPVectorialDrawer.Polyline( @@ -175,7 +190,8 @@ begin MoveTo(APoints[AStartIndex]); for i := 1 to ANumPts - 1 do with APoints[i + AStartIndex] do - FCanvas.AddLineToPath(X, Y, FPenColor); + FCanvas.AddLineToPath(X, Y); + FCanvas.SetPenColor(FPenColor); FCanvas.EndPath(); end; @@ -192,12 +208,21 @@ end; procedure TFPVectorialDrawer.Rectangle(AX1, AY1, AX2, AY2: Integer); begin - // Not implemented. + MoveTo(AX1, AY1); + FCanvas.AddLineToPath(AX2, AY1); + FCanvas.AddLineToPath(AX2, AY2); + FCanvas.AddLineToPath(AX1, AY2); + FCanvas.AddLineToPath(AX1, AY1); + FCanvas.SetBrushColor(FBrushColor); + FCanvas.SetBrushStyle(bsSolid); + FCanvas.SetPenColor(FPenColor); + FCanvas.EndPath(); end; procedure TFPVectorialDrawer.Rectangle(const ARect: TRect); begin - // Not implemented. + with ARect do + Rectangle(Left, Top, Right, Bottom); end; procedure TFPVectorialDrawer.SetBrush(ABrush: TFPCustomBrush);