[Lazarus] Get JPEG from TAChart in CGI app

Alexander Klenin klenin at gmail.com
Sun Mar 20 21:00:20 CET 2011


On Mon, Mar 21, 2011 at 05:42, Leonardo M. Ramé <l.rame at griensu.com> wrote:
>
> [Sun Mar 20 16:30:09 2011] [error] [client ::1] (cgicharts:16246):
> Gtk-WARNING **: cannot open display:
> [Sun Mar 20 16:30:09 2011] [error] [client ::1] Premature end of script
> headers: cgicharts

Unfortunately, I am not an expert in GTK -- it seems that it tries to
initialize display even if there is nothing to draw.
I am not sure if it is fixable -- the demo I posted does work as a CGI
under Apache on Windows, so it may be GTK problem, Lazarus problem,
or X-server/GTK/Apache configuration problem.
You might want to try fpgui widgetset -- it depends only on X,
which may work even if GTK does not.

Of course, it would be ideal to create a version of TAChart that does not
require a widgetset, but the task is complicated by compatibility requirements.
I have already made some progress in this direction -- see
IChartDrawer infrastructure.
TAChart is mostly independent of TCanvas -- it only needs one for events
and interactive tools.
Few drawing back-ends exist -- AggPas, OpenGL, and more are planned,
in particular SVG, which will probably be most suitable for web apps.
Unfortunately, all back-ends have limitations compared to TCanvas
(for example OpenGL has very limited text rendering capabilities,
and "pure" TFPCanvas does not even support TColor).

-- 
Alexander S. Klenin




More information about the Lazarus mailing list