mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 13:32:31 +02:00
TAChart: Use TFPCanvasDrawer and nogui widgetset in nogui demo
git-svn-id: trunk@29966 -
This commit is contained in:
parent
2c5801acc5
commit
a40bfdfa55
@ -19,6 +19,9 @@
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<MacroValues Count="1">
|
||||
<Macro1 Name="LCLWidgetType" Value="nogui"/>
|
||||
</MacroValues>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
|
@ -3,24 +3,38 @@ program noguidemo;
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Classes, tachartlazaruspkg
|
||||
{ you can add units after this },
|
||||
Interfaces, TAGraph, TASeries, Graphics;
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF}
|
||||
Interfaces, Classes, tachartlazaruspkg { you can add units after this },
|
||||
FPCanvas, FPImage, FPImgCanv,
|
||||
TAGraph, TASeries, TADrawerFPCanvas;
|
||||
|
||||
var
|
||||
chart: TChart;
|
||||
bs: TBarSeries;
|
||||
img: TFPMemoryImage;
|
||||
c: TFPImageCanvas;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
chart := TChart.Create(nil);
|
||||
chart.LeftAxis.Marks.Visible := false;
|
||||
chart.LeftAxis.Grid.FPColor := colDkGray;
|
||||
chart.BottomAxis.Marks.Visible := false;
|
||||
chart.BottomAxis.Grid.FPColor := colDkGray;
|
||||
chart.Color := $FFA0A0;
|
||||
chart.BackColor := $FFFFFF;
|
||||
bs := TBarSeries.Create(nil);
|
||||
chart.AddSeries(bs);
|
||||
bs.AddXY(1, 10);
|
||||
bs.AddXY(2, 7);
|
||||
bs.AddXY(3, 8);
|
||||
chart.SaveToBitmapFile('test.bmp');
|
||||
img := TFPMemoryImage.Create(chart.Width, chart.Height);
|
||||
c := TFPImageCanvas.Create(img);
|
||||
chart.Draw(TFPCanvasDrawer.Create(c), Rect(0, 0, chart.Width, chart.Height));
|
||||
img.SaveToFile('test.png');
|
||||
c.Free;
|
||||
img.Free;
|
||||
bs.Free;
|
||||
chart.Free;
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user