Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Using Chart Engine for Browser output
Using Chart Engine for Browser output [message #145784] Sat, 18 March 2006 09:30 Go to next message
Eclipse UserFriend
Originally posted by: diptendu.vsnl.com

The Chart Engine examples that come with BIRT download talk about SWING or
SWT renderers. We want to use simple image renderers such as JPEG or PNG
to be generated from Servlets with the data coming from MySQL. Are
examples for such a scenario available?

Regards,

Diptendu Dutta
Re: Using Chart Engine for Browser output [message #145827 is a reply to message #145784] Mon, 20 March 2006 03:49 Go to previous message
Zhiqiang Qian is currently offline Zhiqiang QianFriend
Messages: 76
Registered: July 2009
Member
Hi Diptendu,

Yes, you can use JpegRenderer and PngRenderer as well. Here is a simple
example:

============================================================ ============
IDeviceRenderer idr = PluginSettings.instance( ) .getDevice( "dv.PNG"
); //$NON-NLS-1$

final Bounds bo = BoundsImpl.create( 0, 0, width, height );
RunTimeContext rtc = new RunTimeContext( );
rtc.setLocale( Locale.getDefault( ) );

final Generator gr = Generator.instance( );
GeneratedChartState gcs = null;
gcs = gr.build( idr.getDisplayServer( ), cm, null, bo, rtc );

final BufferedImage bi = new BufferedImage( (int) bo.getWidth( ), (int)
bo.getHeight( ), BufferedImage.TYPE_INT_ARGB );
idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, bi.getGraphics( ) );

// if you want a file output.
idr.setProperty( IDeviceRenderer.FILE_IDENTIFIER, "c:/test.png" );

// if you just want an in-memory image output.
idr.setProperty( IDeviceRenderer.CACHED_IMAGE, bi );

gr.render( idr, gcs );
============================================================ ============

Hope this helps.

Zhiqiang Qian


Diptendu Dutta wrote:
> The Chart Engine examples that come with BIRT download talk about SWING
> or SWT renderers. We want to use simple image renderers such as JPEG or
> PNG to be generated from Servlets with the data coming from MySQL. Are
> examples for such a scenario available?
>
> Regards,
>
> Diptendu Dutta
>
Previous Topic:Multiple Y Axes in ChartWithAxes using Chart Engine
Next Topic:probleam to create meter chart
Goto Forum:
  


Current Time: Sun Nov 24 17:51:13 GMT 2024

Powered by FUDForum. Page generated in 0.03154 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top