Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » tooltip over x-Axis Label
tooltip over x-Axis Label [message #368540] Tue, 09 June 2009 06:13 Go to next message
christian is currently offline christianFriend
Messages: 5
Registered: July 2009
Junior Member

i have the following problem in my rcp app with a swt control using birt
2.1.2. The x series in my bar chart can contain very long strings. BIRT
displays these by compressing the chart area and extending the area for
the x series labels. they can also overlap the y-axis title (please have a
look at the picture). i tried to cut the x series values in the
beforeDrawAxisLabel()-function (to display "long_name...(1)" or
"long_name...(2)" instead of their full name). now i want to add tooltips
for the labels so that i can display the full string for the user. i tried
some stuff (adding triggers to the x-axis or the x series category) but
that didnt work. i also tried an ONMOUSEOVER_LITERAL and CALL_BACK_LITERAL
combination with the same result.

does anyone know how to add an onMouseOver event/trigger for series
labels? i only need some callback stuff so that i can get the display name
of a label which is hovered by the user. then i could draw a swt tooltip
as a workaround.

thanks Christian
Re: tooltip over x-Axis Label [message #368544 is a reply to message #368540] Tue, 09 June 2009 09:30 Go to previous message
Gernot Veith is currently offline Gernot VeithFriend
Messages: 24
Registered: July 2009
Junior Member
Hello Christian,

to enable tooltips you have to define an action and a trigger. Example:
ActionValue actionValue = TooltipValueImpl.create(500, "xx");
Action action = ActionImpl.create(ActionType.SHOW_TOOLTIP_LITERAL,
Trigger mouseOver =
TriggerImpl.create(TriggerCondition.ONMOUSEOVER_LITERAL,acti on);

Next you must implement IActionRenderer and set it to the RuntimeContext
of the GeneratedChartState when you build the chart.
The problem you will then have is to get the x axis value for the label as
IActionRednerer does not provide the index of the currently rendered label.
Here is an example the a renderer:

public void processAction(Action action, StructureSource source) {

if (action.getType() == ActionType.SHOW_TOOLTIP_LITERAL &&
source.getType() == StructureType.SERIES_DATA_POINT) {
DataPointHints dph = (DataPointHints)source.getSource();
String displayValue = dph.getDisplayValue() + "%";
TooltipValueImpl tooltip = (TooltipValueImpl)action.getValue();

You have to change the StructureType accordingly.
In your case the source object of the StructureSource is the x axis

Previous Topic:Displaying a table based on the value of its data elements
Next Topic:references to meta-model in another Eclipse project
Goto Forum:

Current Time: Mon Jun 26 14:06:24 GMT 2017

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

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