Home » Archived » BIRT » Any examples of JavaScript event handlers setting triggers for charts (Mouse Over etc)?
Any examples of JavaScript event handlers setting triggers for charts (Mouse Over etc)? [message #122293] |
Tue, 31 January 2006 20:28  |
Eclipse User |
|
|
|
Originally posted by: rrachamallu.hotmail.com
Hi,
I have a line chart, I want to define a trigger to show the tool tip when
the user moves the mouse pointer over the Value(Y) Series data points. First
I need to figure out the function in which I need to set up the trigger. I
tried the "beforeGeneration" function with out success.
I checked the code examples in org.eclipse.birt.chart.examples plugin.
Still I am unable to make this work. If you have an example that you can
share, it will be great.
Thanks
Reddy
|
|
| |
Re: Any examples of JavaScript event handlers setting triggers for charts (Mouse Over etc)? [message #122807 is a reply to message #122491] |
Wed, 01 February 2006 12:51   |
Eclipse User |
|
|
|
Originally posted by: rrachamallu.hotmail.com
Hi David,
There is no problem with the examples plugin.
I could also set the tooltip using the designer. What I am trying to do is
to set the tooltip using JavaScript. I am doing this as an excercise before
writing more complicated event handlers.
Here is what I tried (based on the code from example plugin)
Attempt 1:
function beforeDrawSeries( series, seriesRenderer, context )
{
series.getTriggers( ).add( TriggerImpl.create(
TriggerCondition.ONMOUSEOVER_LITERAL,
ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
TooltipValueImpl.create( 200, "abc" ) ) ) );
}
Attempt 2:
function beforeGeneration( chart, context )
{
var series = chart.getSeriesForLegend().getDesignTimeSeries();
series.getTriggers( ).add( TriggerImpl.create(
TriggerCondition.ONMOUSEOVER_LITERAL,
ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
TooltipValueImpl.create( 200, "abc" ) ) ) );
}
Both of these did not work. Your feedback will be greatly appreciated.
Thanks
Reddy
PS: I just registered for the "BIRT In Depth" class at eclipsecon 2006
"David Michonneau" <dmichonneau@actuate.com> wrote in message
news:drpr0a$pvi$1@utils.eclipse.org...
> Hi Reddy,
>
> What's the problem with the examples plugin? There is a tooltip example
> there.
>
> Thanks,
>
> David
>
> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
> news:drp2j4$nn7$1@utils.eclipse.org...
>> Hi,
>> I have a line chart, I want to define a trigger to show the tool tip
>> when the user moves the mouse pointer over the Value(Y) Series data
>> points. First I need to figure out the function in which I need to set up
>> the trigger. I tried the "beforeGeneration" function with out success.
>> I checked the code examples in org.eclipse.birt.chart.examples plugin.
>> Still I am unable to make this work. If you have an example that you can
>> share, it will be great.
>>
>> Thanks
>> Reddy
>>
>
>
|
|
|
Re: Any examples of JavaScript event handlers setting triggers for charts (Mouse Over etc)? [message #122885 is a reply to message #122807] |
Wed, 01 February 2006 15:53   |
Eclipse User |
|
|
|
The importPackage is missing to access some classes. When you reference a
Java class inside JavaScript code, you need to import its package.
So change the function to:
function beforeDrawSeries( series, seriesRenderer, context )
{
importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);
importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
importPackage(Packages.org.eclipse.birt.chart.model.attribut e.impl);
series.getTriggers( ).add( TriggerImpl.create(
TriggerCondition.ONMOUSEOVER_LITERAL,
ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
TooltipValueImpl.create( 200, "abc" ) ) ) );
}
Unfortunately the tooltip value gets overriden by the value of the
datapoint. You can file a bug in bugzilla for this, if a value is set, we
should not override it. http://bugs.eclipse.org/bugs . I hope it's not a big
issue for you, it has gone unnoticed since usually we do not set the same
tooltip for all the datapoint values, and this script+interactivity scenario
where you could put a different tooltip for each point based on some
scripting logic was not taken into account.
Thanks,
David
"Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
news:drqs6a$r1h$1@utils.eclipse.org...
> Hi David,
> There is no problem with the examples plugin.
> I could also set the tooltip using the designer. What I am trying to do
> is to set the tooltip using JavaScript. I am doing this as an excercise
> before writing more complicated event handlers.
> Here is what I tried (based on the code from example plugin)
>
> Attempt 1:
> function beforeDrawSeries( series, seriesRenderer, context )
> {
> series.getTriggers( ).add( TriggerImpl.create(
> TriggerCondition.ONMOUSEOVER_LITERAL,
> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
> TooltipValueImpl.create( 200, "abc" ) ) ) );
> }
>
> Attempt 2:
> function beforeGeneration( chart, context )
> {
> var series = chart.getSeriesForLegend().getDesignTimeSeries();
> series.getTriggers( ).add( TriggerImpl.create(
> TriggerCondition.ONMOUSEOVER_LITERAL,
> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
> TooltipValueImpl.create( 200, "abc" ) ) ) );
> }
>
> Both of these did not work. Your feedback will be greatly appreciated.
>
> Thanks
> Reddy
>
> PS: I just registered for the "BIRT In Depth" class at eclipsecon 2006
>
>
> "David Michonneau" <dmichonneau@actuate.com> wrote in message
> news:drpr0a$pvi$1@utils.eclipse.org...
>> Hi Reddy,
>>
>> What's the problem with the examples plugin? There is a tooltip example
>> there.
>>
>> Thanks,
>>
>> David
>>
>> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
>> news:drp2j4$nn7$1@utils.eclipse.org...
>>> Hi,
>>> I have a line chart, I want to define a trigger to show the tool tip
>>> when the user moves the mouse pointer over the Value(Y) Series data
>>> points. First I need to figure out the function in which I need to set
>>> up the trigger. I tried the "beforeGeneration" function with out
>>> success.
>>> I checked the code examples in org.eclipse.birt.chart.examples plugin.
>>> Still I am unable to make this work. If you have an example that you can
>>> share, it will be great.
>>>
>>> Thanks
>>> Reddy
>>>
>>
>>
>
>
|
|
|
Re: Any examples of JavaScript event handlers setting triggers for charts (Mouse Over etc)? [message #125096 is a reply to message #122885] |
Tue, 07 February 2006 01:11   |
Eclipse User |
|
|
|
Originally posted by: rrachamallu.hotmail.com
Hi David,
Thanks for the code. It worked.
Regarding the tooltip, it would have been nice if we could have a tooltip
that could take the data point add some formatting and then display it. But
it is not a show-stopper for me.
Thanks
Reddy
"David Michonneau" <dmichonneau@actuate.com> wrote in message
news:drr73v$tnc$1@utils.eclipse.org...
> The importPackage is missing to access some classes. When you reference a
> Java class inside JavaScript code, you need to import its package.
>
> So change the function to:
>
> function beforeDrawSeries( series, seriesRenderer, context )
>
> {
>
> importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);
>
> importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
>
> importPackage(Packages.org.eclipse.birt.chart.model.attribut e.impl);
>
> series.getTriggers( ).add( TriggerImpl.create(
>
> TriggerCondition.ONMOUSEOVER_LITERAL,
>
> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>
> TooltipValueImpl.create( 200, "abc" ) ) ) );
>
> }
>
> Unfortunately the tooltip value gets overriden by the value of the
> datapoint. You can file a bug in bugzilla for this, if a value is set, we
> should not override it. http://bugs.eclipse.org/bugs . I hope it's not a
> big issue for you, it has gone unnoticed since usually we do not set the
> same tooltip for all the datapoint values, and this script+interactivity
> scenario where you could put a different tooltip for each point based on
> some scripting logic was not taken into account.
>
> Thanks,
>
> David
>
> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
> news:drqs6a$r1h$1@utils.eclipse.org...
>> Hi David,
>> There is no problem with the examples plugin.
>> I could also set the tooltip using the designer. What I am trying to do
>> is to set the tooltip using JavaScript. I am doing this as an excercise
>> before writing more complicated event handlers.
>> Here is what I tried (based on the code from example plugin)
>>
>> Attempt 1:
>> function beforeDrawSeries( series, seriesRenderer, context )
>> {
>> series.getTriggers( ).add( TriggerImpl.create(
>> TriggerCondition.ONMOUSEOVER_LITERAL,
>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>> }
>>
>> Attempt 2:
>> function beforeGeneration( chart, context )
>> {
>> var series = chart.getSeriesForLegend().getDesignTimeSeries();
>> series.getTriggers( ).add( TriggerImpl.create(
>> TriggerCondition.ONMOUSEOVER_LITERAL,
>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>> }
>>
>> Both of these did not work. Your feedback will be greatly appreciated.
>>
>> Thanks
>> Reddy
>>
>> PS: I just registered for the "BIRT In Depth" class at eclipsecon 2006
>>
>>
>> "David Michonneau" <dmichonneau@actuate.com> wrote in message
>> news:drpr0a$pvi$1@utils.eclipse.org...
>>> Hi Reddy,
>>>
>>> What's the problem with the examples plugin? There is a tooltip example
>>> there.
>>>
>>> Thanks,
>>>
>>> David
>>>
>>> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
>>> news:drp2j4$nn7$1@utils.eclipse.org...
>>>> Hi,
>>>> I have a line chart, I want to define a trigger to show the tool tip
>>>> when the user moves the mouse pointer over the Value(Y) Series data
>>>> points. First I need to figure out the function in which I need to set
>>>> up the trigger. I tried the "beforeGeneration" function with out
>>>> success.
>>>> I checked the code examples in org.eclipse.birt.chart.examples plugin.
>>>> Still I am unable to make this work. If you have an example that you
>>>> can share, it will be great.
>>>>
>>>> Thanks
>>>> Reddy
>>>>
>>>
>>>
>>
>>
>
>
|
|
|
Re: Any examples of JavaScript event handlers setting triggers for charts (Mouse Over etc)? [message #125122 is a reply to message #125096] |
Tue, 07 February 2006 03:24   |
Eclipse User |
|
|
|
Hi Reddy,
There is such feature already, you don't even need to use scripting for
that. You can go to the Series interactivity dialog in the builder and set
the onmouseover/tooltip. The value of the tooltip is the label for the
datapoint (you can set invisible so that it shows only when hovering). The
formatting of your datapoint label applies to the tooltip.
Thanks,
David
"Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
news:ds9dcj$q1f$1@utils.eclipse.org...
> Hi David,
> Thanks for the code. It worked.
> Regarding the tooltip, it would have been nice if we could have a tooltip
> that could take the data point add some formatting and then display it.
> But it is not a show-stopper for me.
> Thanks
> Reddy
>
> "David Michonneau" <dmichonneau@actuate.com> wrote in message
> news:drr73v$tnc$1@utils.eclipse.org...
>> The importPackage is missing to access some classes. When you reference a
>> Java class inside JavaScript code, you need to import its package.
>>
>> So change the function to:
>>
>> function beforeDrawSeries( series, seriesRenderer, context )
>>
>> {
>>
>> importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);
>>
>> importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
>>
>> importPackage(Packages.org.eclipse.birt.chart.model.attribut e.impl);
>>
>> series.getTriggers( ).add( TriggerImpl.create(
>>
>> TriggerCondition.ONMOUSEOVER_LITERAL,
>>
>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>>
>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>>
>> }
>>
>> Unfortunately the tooltip value gets overriden by the value of the
>> datapoint. You can file a bug in bugzilla for this, if a value is set, we
>> should not override it. http://bugs.eclipse.org/bugs . I hope it's not a
>> big issue for you, it has gone unnoticed since usually we do not set the
>> same tooltip for all the datapoint values, and this script+interactivity
>> scenario where you could put a different tooltip for each point based on
>> some scripting logic was not taken into account.
>>
>> Thanks,
>>
>> David
>>
>> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
>> news:drqs6a$r1h$1@utils.eclipse.org...
>>> Hi David,
>>> There is no problem with the examples plugin.
>>> I could also set the tooltip using the designer. What I am trying to do
>>> is to set the tooltip using JavaScript. I am doing this as an excercise
>>> before writing more complicated event handlers.
>>> Here is what I tried (based on the code from example plugin)
>>>
>>> Attempt 1:
>>> function beforeDrawSeries( series, seriesRenderer, context )
>>> {
>>> series.getTriggers( ).add( TriggerImpl.create(
>>> TriggerCondition.ONMOUSEOVER_LITERAL,
>>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>>> }
>>>
>>> Attempt 2:
>>> function beforeGeneration( chart, context )
>>> {
>>> var series = chart.getSeriesForLegend().getDesignTimeSeries();
>>> series.getTriggers( ).add( TriggerImpl.create(
>>> TriggerCondition.ONMOUSEOVER_LITERAL,
>>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>>> }
>>>
>>> Both of these did not work. Your feedback will be greatly appreciated.
>>>
>>> Thanks
>>> Reddy
>>>
>>> PS: I just registered for the "BIRT In Depth" class at eclipsecon 2006
>>>
>>>
>>> "David Michonneau" <dmichonneau@actuate.com> wrote in message
>>> news:drpr0a$pvi$1@utils.eclipse.org...
>>>> Hi Reddy,
>>>>
>>>> What's the problem with the examples plugin? There is a tooltip example
>>>> there.
>>>>
>>>> Thanks,
>>>>
>>>> David
>>>>
>>>> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
>>>> news:drp2j4$nn7$1@utils.eclipse.org...
>>>>> Hi,
>>>>> I have a line chart, I want to define a trigger to show the tool tip
>>>>> when the user moves the mouse pointer over the Value(Y) Series data
>>>>> points. First I need to figure out the function in which I need to set
>>>>> up the trigger. I tried the "beforeGeneration" function with out
>>>>> success.
>>>>> I checked the code examples in org.eclipse.birt.chart.examples
>>>>> plugin. Still I am unable to make this work. If you have an example
>>>>> that you can share, it will be great.
>>>>>
>>>>> Thanks
>>>>> Reddy
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
|
|
|
Re: Any examples of JavaScript event handlers setting triggers for charts (Mouse Over etc)? [message #125555 is a reply to message #125122] |
Tue, 07 February 2006 12:59  |
Eclipse User |
|
|
|
Originally posted by: rrachamallu.hotmail.com
Hi David,
Thanks. It works. I am now able to format the tooltips.
Reddy
"David Michonneau" <dmichonneau@actuate.com> wrote in message
news:ds9lf3$6bc$1@utils.eclipse.org...
> Hi Reddy,
>
> There is such feature already, you don't even need to use scripting for
> that. You can go to the Series interactivity dialog in the builder and set
> the onmouseover/tooltip. The value of the tooltip is the label for the
> datapoint (you can set invisible so that it shows only when hovering). The
> formatting of your datapoint label applies to the tooltip.
>
> Thanks,
>
> David
>
> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
> news:ds9dcj$q1f$1@utils.eclipse.org...
>> Hi David,
>> Thanks for the code. It worked.
>> Regarding the tooltip, it would have been nice if we could have a
>> tooltip that could take the data point add some formatting and then
>> display it. But it is not a show-stopper for me.
>> Thanks
>> Reddy
>>
>> "David Michonneau" <dmichonneau@actuate.com> wrote in message
>> news:drr73v$tnc$1@utils.eclipse.org...
>>> The importPackage is missing to access some classes. When you reference
>>> a Java class inside JavaScript code, you need to import its package.
>>>
>>> So change the function to:
>>>
>>> function beforeDrawSeries( series, seriesRenderer, context )
>>>
>>> {
>>>
>>> importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);
>>>
>>> importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
>>>
>>> importPackage(Packages.org.eclipse.birt.chart.model.attribut e.impl);
>>>
>>> series.getTriggers( ).add( TriggerImpl.create(
>>>
>>> TriggerCondition.ONMOUSEOVER_LITERAL,
>>>
>>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>>>
>>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>>>
>>> }
>>>
>>> Unfortunately the tooltip value gets overriden by the value of the
>>> datapoint. You can file a bug in bugzilla for this, if a value is set,
>>> we should not override it. http://bugs.eclipse.org/bugs . I hope it's
>>> not a big issue for you, it has gone unnoticed since usually we do not
>>> set the same tooltip for all the datapoint values, and this
>>> script+interactivity scenario where you could put a different tooltip
>>> for each point based on some scripting logic was not taken into account.
>>>
>>> Thanks,
>>>
>>> David
>>>
>>> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
>>> news:drqs6a$r1h$1@utils.eclipse.org...
>>>> Hi David,
>>>> There is no problem with the examples plugin.
>>>> I could also set the tooltip using the designer. What I am trying to
>>>> do is to set the tooltip using JavaScript. I am doing this as an
>>>> excercise before writing more complicated event handlers.
>>>> Here is what I tried (based on the code from example plugin)
>>>>
>>>> Attempt 1:
>>>> function beforeDrawSeries( series, seriesRenderer, context )
>>>> {
>>>> series.getTriggers( ).add( TriggerImpl.create(
>>>> TriggerCondition.ONMOUSEOVER_LITERAL,
>>>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>>>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>>>> }
>>>>
>>>> Attempt 2:
>>>> function beforeGeneration( chart, context )
>>>> {
>>>> var series = chart.getSeriesForLegend().getDesignTimeSeries();
>>>> series.getTriggers( ).add( TriggerImpl.create(
>>>> TriggerCondition.ONMOUSEOVER_LITERAL,
>>>> ActionImpl.create( ActionType.SHOW_TOOLTIP_LITERAL,
>>>> TooltipValueImpl.create( 200, "abc" ) ) ) );
>>>> }
>>>>
>>>> Both of these did not work. Your feedback will be greatly appreciated.
>>>>
>>>> Thanks
>>>> Reddy
>>>>
>>>> PS: I just registered for the "BIRT In Depth" class at eclipsecon 2006
>>>>
>>>>
>>>> "David Michonneau" <dmichonneau@actuate.com> wrote in message
>>>> news:drpr0a$pvi$1@utils.eclipse.org...
>>>>> Hi Reddy,
>>>>>
>>>>> What's the problem with the examples plugin? There is a tooltip
>>>>> example there.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> David
>>>>>
>>>>> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
>>>>> news:drp2j4$nn7$1@utils.eclipse.org...
>>>>>> Hi,
>>>>>> I have a line chart, I want to define a trigger to show the tool tip
>>>>>> when the user moves the mouse pointer over the Value(Y) Series data
>>>>>> points. First I need to figure out the function in which I need to
>>>>>> set up the trigger. I tried the "beforeGeneration" function with out
>>>>>> success.
>>>>>> I checked the code examples in org.eclipse.birt.chart.examples
>>>>>> plugin. Still I am unable to make this work. If you have an example
>>>>>> that you can share, it will be great.
>>>>>>
>>>>>> Thanks
>>>>>> Reddy
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
|
|
|
Goto Forum:
Current Time: Sun Jul 27 15:25:00 EDT 2025
Powered by FUDForum. Page generated in 0.05838 seconds
|