TAChart: Support pen style in SVG drawer

git-svn-id: trunk@30215 -
This commit is contained in:
ask 2011-04-06 00:19:29 +00:00
parent 3118c71a3f
commit bdf0c74b20

View File

@ -255,6 +255,8 @@ end;
procedure TSVGDrawer.PrepareSimplePen(AColor: TChartColor);
begin
FPen.FPColor := FChartColorToFPColorFunc(AColor);
FPen.Style := psSolid;
FPen.Width := 1;
end;
procedure TSVGDrawer.RadialPie(
@ -302,6 +304,7 @@ end;
procedure TSVGDrawer.SetPen(APen: TFPCustomPen);
begin
FPen.FPColor := APen.FPColor;
FPen.Style := APen.Style;
FPen.Width := APen.Width;
end;
@ -337,10 +340,17 @@ begin
end;
function TSVGDrawer.StyleStroke: String;
const
PEN_DASHARRAY: array [TFPPenStyle] of String =
('', '2,2', '1,1', '2,1,1,1', '2,1,1,1,1,1', '', '', '');
begin
if FPen.Style = psClear then
exit('stroke: none');
Result := 'stroke:' + ColorToHex(FPen.FPColor) + ';';
if FPen.Width <> 1 then
Result += 'stroke-width:' + IntToStr(FPen.Width) + ';';
if PEN_DASHARRAY[FPen.Style] <> '' then
Result += 'stroke-dasharray:' + PEN_DASHARRAY[FPen.Style] + ';';
end;
procedure TSVGDrawer.WriteFmt(const AFormat: String; AParams: array of const);