<div dir="ltr">2013/1/28 silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">2013/1/28 Graeme Geldenhuys <span dir="ltr"><<a href="mailto:graeme@geldenhuys.co.uk" target="_blank">graeme@geldenhuys.co.uk</a>></span><br><div class="gmail_extra"><div class="im"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>On 01/28/13 23:32, silvioprog wrote:<br>
>> Not for lines.<br>
><br>
><br>
> Sniff. :'(<br>
><br>
> I'm trying to generate charts in my CGI apps:<br><br>
</div>Use AggPas. That is exactly why I incorporated it into fpGUI. I needed<br>
anti-aliased line drawing for graphs etc.<br>
<br>
<br>
Regards,<br>
- Graeme -<br></blockquote></div><div><br></div></div><div>Installing it now (<a href="http://imagebin.org/244603" target="_blank">http://imagebin.org/244603</a>). Thank you Graeme! :)</div></div></div></blockquote><div>
<br></div><div style>Fail. :(</div><div style><br></div><div>program noguidemo;</div><div><br></div><div>{$mode objfpc}{$H+}</div><div><br></div><div>uses</div><div> Interfaces,</div><div> Classes,</div><div> FPCanvas,</div>
<div> FPImage,</div><div> TATools,</div><div> TAGraph,</div><div> TASeries,</div><div> TADrawerFPCanvas,</div><div> TADrawerCanvas,</div><div> TADrawUtils,</div><div> agg_fpimage;</div><div><br></div><div>var</div>
<div> chart: TChart;</div><div> bs: TBarSeries;</div><div> c: TAggFPCanvas;</div><div> d: IChartDrawer;</div><div>begin</div><div> chart := TChart.Create(nil);</div><div> <a href="http://chart.LeftAxis.Marks.LabelFont.Name">chart.LeftAxis.Marks.LabelFont.Name</a> := 'Arial';</div>
<div> chart.LeftAxis.Marks.LabelFont.Size := 10;</div><div> chart.LeftAxis.Marks.LabelFont.Orientation := 450;</div><div> chart.LeftAxis.Marks.Frame.Visible := True;</div><div> chart.LeftAxis.Marks.Frame.Style := psSolid;</div>
<div> chart.LeftAxis.Marks.Frame.FPColor := colBlack;</div><div> chart.LeftAxis.Grid.FPColor := colDkGray;</div><div> chart.BottomAxis.Marks.Visible := False;</div><div> chart.BottomAxis.Grid.FPColor := colDkGray;</div>
<div> chart.Color := $FFA0A0;</div><div> chart.BackColor := $FFFFFF;</div><div> bs := TBarSeries.Create(nil);</div><div> chart.AddSeries(bs);</div><div> bs.AddXY(1, 10);</div><div> bs.AddXY(2, 7);</div><div> bs.AddXY(3, 8);</div>
<div> c := TAggFPCanvas.Create;</div><div> c.Width := chart.Width;</div><div> c.Height := chart.Height;</div><div> d := TFPCanvasDrawer.Create(c);</div><div> d.DoGetFontOrientation := @CanvasGetFontOrientationFunc;</div>
<div> chart.Draw(d, Rect(0, 0, chart.Width, chart.Height));</div><div> c.Image.SaveToFile('test.png');</div><div> c.Free;</div><div> bs.Free;</div><div> chart.Free;</div><div style>end.</div></div><br clear="all">
<div style>The result is:</div><div style><br></div><div style><a href="http://imagebin.org/244608">http://imagebin.org/244608</a><br></div><div><br></div><div>I may be using the wrong way, but I did not find documentation to help me with this. :/<br>
</div><div><br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>