Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Eclipse Chart Engine, PNG, and ImageMap
Eclipse Chart Engine, PNG, and ImageMap [message #186425] Mon, 21 August 2006 17:02 Go to next message
Eclipse UserFriend
Originally posted by: molson.airinc.com

Hi, I am having a problem creating an imagemap for a chart I have
created. I am able to create a PNG image just fine and have it display
in a browser, however the imagemap I get is always null.

When I create my chart, I add triggers to my bar series like so:

bsY11.getTriggers( ).add(
TriggerImpl.create(
TriggerCondition.ONMOUSEOVER_LITERAL,
ActionImpl.create(
ActionType.SHOW_TOOLTIP_LITERAL,
TooltipValueImpl.create( 500, "my label" )
)
)
);


I then have a servlet to create the png image. That works fine, but my
image map is being returned as null.

here is the interesting part of my get ( cm is the chart ):

IDeviceRenderer idr = null;
final PluginSettings ps = PluginSettings.instance( );
try
{
idr = ps.getDevice( "dv.PNG" );
}
catch ( ChartException ex )
{
ex.printStackTrace( );
}

// Create a buffered image
BufferedImage image = new BufferedImage( width,
height,
BufferedImage.TYPE_INT_ARGB );

// Draw the chart in the buffered image
Graphics2D g2d = (Graphics2D) image.getGraphics( );
idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, g2d );

Bounds bo = BoundsImpl.create( 0, 0, width, height );
bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );

Generator gr = Generator.instance( );

try
{
idr.setProperty( IDeviceRenderer.CACHED_IMAGE, image );
gr.render( idr, gr.build( idr.getDisplayServer( ),
cm,
bo,
null,
null,
null ) );
}
catch ( ChartException ex )
{
ex.printStackTrace( );
}

g2d.dispose( );

IImageMapEmitter test = (IImageMapEmitter)idr;
String vals = test.getImageMap();

....



vals is null, despite the fact that I know there are triggers set up for
the bar series in the chart. Any idea why?

Cheer,
Mike
Re: Eclipse Chart Engine, PNG, and ImageMap [message #186433 is a reply to message #186425] Mon, 21 August 2006 17:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: remberson.edgedynamics.com

molson wrote:
> Hi, I am having a problem creating an imagemap for a chart I have
> created. I am able to create a PNG image just fine and have it display
> in a browser, however the imagemap I get is always null.
>
> When I create my chart, I add triggers to my bar series like so:
>
> bsY11.getTriggers( ).add(
> TriggerImpl.create(
> TriggerCondition.ONMOUSEOVER_LITERAL,
> ActionImpl.create(
> ActionType.SHOW_TOOLTIP_LITERAL,
> TooltipValueImpl.create( 500, "my label" )
> )
> )
> );
>
>
> I then have a servlet to create the png image. That works fine, but my
> image map is being returned as null.
>
> here is the interesting part of my get ( cm is the chart ):
>
> IDeviceRenderer idr = null;
> final PluginSettings ps = PluginSettings.instance( );
> try
> {
> idr = ps.getDevice( "dv.PNG" );
> }
> catch ( ChartException ex )
> {
> ex.printStackTrace( );
> }
>
> // Create a buffered image
> BufferedImage image = new BufferedImage( width,
> height,
> BufferedImage.TYPE_INT_ARGB );
>
> // Draw the chart in the buffered image
> Graphics2D g2d = (Graphics2D) image.getGraphics( );
> idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, g2d );
>
> Bounds bo = BoundsImpl.create( 0, 0, width, height );
> bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
>
> Generator gr = Generator.instance( );
>
> try
> {
> idr.setProperty( IDeviceRenderer.CACHED_IMAGE, image );
> gr.render( idr, gr.build( idr.getDisplayServer( ),
> cm,
> bo,
> null,
> null,
> null ) );
> }
> catch ( ChartException ex )
> {
> ex.printStackTrace( );
> }
>
> g2d.dispose( );
>
> IImageMapEmitter test = (IImageMapEmitter)idr;
> String vals = test.getImageMap();
>
> ...
>
>
>
> vals is null, despite the fact that I know there are triggers set up for
> the bar series in the chart. Any idea why?
>
> Cheer,
> Mike
Create/Alter/Delete reports at JBoss/WebSphere/WebLogic runtime [message #186441 is a reply to message #186425] Mon, 21 August 2006 17:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: remberson.edgedynamics.com

How can one create, alter, and delete reports at
runtime with any of the following
application servers web servers:
JBoss, WebSphere and WebLogic?

I'm not talking about the content of a report but
rather the reports themselves. Client developers will be
managing the reports (creating, altering and deleting),
the application is responsible for the deployment
of the reports while client users will access the
reports via the appserver web servers.

So, for JBoss one generally has enough information in ones
ear to hot-deploy new reports (I assume), but for
WebSphere and WebLogic does anyone have any
(positive) experience?

Thanks.

Richard
Re: Eclipse Chart Engine, PNG, and ImageMap [message #186516 is a reply to message #186425] Tue, 22 August 2006 08:25 Go to previous messageGo to next message
Zhiqiang Qian is currently offline Zhiqiang QianFriend
Messages: 76
Registered: July 2009
Member
try add this before you call gr.render(),

idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER,
new EmptyUpdateNotifier( cm, gcs.getChartModel( ) ) );

gcs is the return value of gr.build().

molson wrote:
> Hi, I am having a problem creating an imagemap for a chart I have
> created. I am able to create a PNG image just fine and have it display
> in a browser, however the imagemap I get is always null.
>
> When I create my chart, I add triggers to my bar series like so:
>
> bsY11.getTriggers( ).add(
> TriggerImpl.create(
> TriggerCondition.ONMOUSEOVER_LITERAL,
> ActionImpl.create(
> ActionType.SHOW_TOOLTIP_LITERAL,
> TooltipValueImpl.create( 500, "my label" )
> )
> )
> );
>
>
> I then have a servlet to create the png image. That works fine, but my
> image map is being returned as null.
>
> here is the interesting part of my get ( cm is the chart ):
>
> IDeviceRenderer idr = null;
> final PluginSettings ps = PluginSettings.instance( );
> try
> {
> idr = ps.getDevice( "dv.PNG" );
> }
> catch ( ChartException ex )
> {
> ex.printStackTrace( );
> }
>
> // Create a buffered image
> BufferedImage image = new BufferedImage( width,
> height,
> BufferedImage.TYPE_INT_ARGB );
>
> // Draw the chart in the buffered image
> Graphics2D g2d = (Graphics2D) image.getGraphics( );
> idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, g2d );
>
> Bounds bo = BoundsImpl.create( 0, 0, width, height );
> bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
>
> Generator gr = Generator.instance( );
>
> try
> {
> idr.setProperty( IDeviceRenderer.CACHED_IMAGE, image );
> gr.render( idr, gr.build( idr.getDisplayServer( ),
> cm,
> bo,
> null,
> null,
> null ) );
> }
> catch ( ChartException ex )
> {
> ex.printStackTrace( );
> }
>
> g2d.dispose( );
>
> IImageMapEmitter test = (IImageMapEmitter)idr;
> String vals = test.getImageMap();
>
> ...
>
>
>
> vals is null, despite the fact that I know there are triggers set up for
> the bar series in the chart. Any idea why?
>
> Cheer,
> Mike
Re: Eclipse Chart Engine, PNG, and ImageMap [message #186796 is a reply to message #186516] Thu, 24 August 2006 14:55 Go to previous message
Eclipse UserFriend
Originally posted by: molson.airinc.com

This works great foir ONMOUSEOVER_LITERAL triggers, however, when I use
ONMOUSEDOWN_LITERAL, my imagemap is an empty string. Shouldn't imagemap
support mousedown?

Here is my trigger code

bsY11.getTriggers( ).add(
TriggerImpl.create(
TriggerCondition.ONMOUSEDOWN_LITERAL,
ActionImpl.create(
ActionType.URL_REDIRECT_LITERAL,
URLValueImpl.create( "http://www.actuate.com", null, null, null, null )
)
)
);

Any ideas?

Zhiqiang Qian wrote:
> try add this before you call gr.render(),
>
> idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER,
> new EmptyUpdateNotifier( cm, gcs.getChartModel( ) ) );
>
> gcs is the return value of gr.build().
>
> molson wrote:
>
>> Hi, I am having a problem creating an imagemap for a chart I have
>> created. I am able to create a PNG image just fine and have it
>> display in a browser, however the imagemap I get is always null.
>>
>> When I create my chart, I add triggers to my bar series like so:
>>
>> bsY11.getTriggers( ).add(
>> TriggerImpl.create(
>> TriggerCondition.ONMOUSEOVER_LITERAL,
>> ActionImpl.create(
>> ActionType.SHOW_TOOLTIP_LITERAL,
>> TooltipValueImpl.create( 500, "my label" )
>> )
>> )
>> );
>>
>>
>> I then have a servlet to create the png image. That works fine, but
>> my image map is being returned as null.
>>
>> here is the interesting part of my get ( cm is the chart ):
>>
>> IDeviceRenderer idr = null;
>> final PluginSettings ps = PluginSettings.instance( );
>> try
>> {
>> idr = ps.getDevice( "dv.PNG" );
>> }
>> catch ( ChartException ex )
>> {
>> ex.printStackTrace( );
>> }
>>
>> // Create a buffered image
>> BufferedImage image = new BufferedImage( width,
>> height,
>> BufferedImage.TYPE_INT_ARGB );
>>
>> // Draw the chart in the buffered image
>> Graphics2D g2d = (Graphics2D) image.getGraphics( );
>> idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, g2d );
>>
>> Bounds bo = BoundsImpl.create( 0, 0, width, height );
>> bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
>>
>> Generator gr = Generator.instance( );
>>
>> try
>> {
>> idr.setProperty( IDeviceRenderer.CACHED_IMAGE, image );
>> gr.render( idr, gr.build( idr.getDisplayServer( ),
>> cm,
>> bo,
>> null,
>> null,
>> null ) );
>> }
>> catch ( ChartException ex )
>> {
>> ex.printStackTrace( );
>> }
>> g2d.dispose( );
>> IImageMapEmitter test = (IImageMapEmitter)idr;
>> String vals = test.getImageMap();
>>
>> ...
>>
>>
>>
>> vals is null, despite the fact that I know there are triggers set up
>> for the bar series in the chart. Any idea why?
>>
>> Cheer,
>> Mike
Previous Topic:Table column problem!!!!!!!
Next Topic:where is BIRT-2.1 API documentation
Goto Forum:
  


Current Time: Fri Oct 18 01:50:52 GMT 2024

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

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

Back to the top