Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Set label of marker in a chart
Set label of marker in a chart [message #648738] Fri, 14 January 2011 11:00 Go to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
Hi,
I want to change the label of a marker in a chart via script. I use
beforeDrawMarkerLine function (see below). The following (setLabel) does
not work (this error:
Can't find method
org.eclipse.birt.chart.model.component.impl.MarkerLineImpl.s etLabel(string).
at line 19 of chart script:'')

Perhaps anybody can give me a hint. thanks.


function beforeDrawMarkerLine(axis, markerLine, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
var min_value =
icsc.getExternalContext().getScriptable().getPersistentGloba lVariable( "min_val");
markerLine.setValue(NumberDataElementImpl.create(min_value)) ;

markerLine.setLabel("Value: " + min_value);
}
Re: Set label of marker in a chart [message #648832 is a reply to message #648738] Fri, 14 January 2011 16:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Add
importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl)
right above where you calculate the min_value.

Jason



On 1/14/2011 6:00 AM, Klaus Meisl wrote:
> Hi,
> I want to change the label of a marker in a chart via script. I use
> beforeDrawMarkerLine function (see below). The following (setLabel) does
> not work (this error:
> Can't find method
> org.eclipse.birt.chart.model.component.impl.MarkerLineImpl.s etLabel(string).
> at line 19 of chart script:'')
>
> Perhaps anybody can give me a hint. thanks.
>
>
> function beforeDrawMarkerLine(axis, markerLine, icsc)
> {
> importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
> var min_value =
> icsc.getExternalContext().getScriptable().getPersistentGloba lVariable( "min_val");
> markerLine.setValue(NumberDataElementImpl.create(min_value)) ;
>
> markerLine.setLabel("Value: " + min_value);
> }
Re: Set label of marker in a chart [message #648873 is a reply to message #648832] Fri, 14 January 2011 18:34 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
Jason,

setting the line works fine, it just does not set the label of the line.
My script now looks like this, but the error remains.

function beforeDrawMarkerLine(axis, markerLine, icsc)
{
importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);
importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl);
var min_value =
icsc.getExternalContext().getScriptable().getPersistentGloba lVariable( "min_val");
markerLine.setValue(NumberDataElementImpl.create(min_value)) ;
// works fine so far

// this does not work
markerLine.setLabel("This is the line");
}


Am 14.01.11 17:27, schrieb Jason Weathersby:
> Add
> importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl)
> right above where you calculate the min_value.
>
> Jason
>
>
>
> On 1/14/2011 6:00 AM, Klaus Meisl wrote:
>> Hi,
>> I want to change the label of a marker in a chart via script. I use
>> beforeDrawMarkerLine function (see below). The following (setLabel) does
>> not work (this error:
>> Can't find method
>> org.eclipse.birt.chart.model.component.impl.MarkerLineImpl.s etLabel(string).
>>
>> at line 19 of chart script:'')
>>
>> Perhaps anybody can give me a hint. thanks.
>>
>>
>> function beforeDrawMarkerLine(axis, markerLine, icsc)
>> {
>> importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
>> var min_value =
>> icsc.getExternalContext().getScriptable().getPersistentGloba lVariable( "min_val");
>>
>> markerLine.setValue(NumberDataElementImpl.create(min_value)) ;
>>
>> markerLine.setLabel("Value: " + min_value);
>> }
>
Re: Set label of marker in a chart [message #649119 is a reply to message #648873] Mon, 17 January 2011 18:32 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Try:

markerLine.getLabel().getCaption().setValue("Test");


On 1/14/2011 1:34 PM, Klaus Meisl wrote:
> Jason,
>
> setting the line works fine, it just does not set the label of the line.
> My script now looks like this, but the error remains.
>
> function beforeDrawMarkerLine(axis, markerLine, icsc)
> {
> importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);
> importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl);
> var min_value =
> icsc.getExternalContext().getScriptable().getPersistentGloba lVariable( "min_val");
> markerLine.setValue(NumberDataElementImpl.create(min_value)) ;
> // works fine so far
>
> // this does not work
> markerLine.setLabel("This is the line");
> }
>
>
> Am 14.01.11 17:27, schrieb Jason Weathersby:
>> Add
>> importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl)
>> right above where you calculate the min_value.
>>
>> Jason
>>
>>
>>
>> On 1/14/2011 6:00 AM, Klaus Meisl wrote:
>>> Hi,
>>> I want to change the label of a marker in a chart via script. I use
>>> beforeDrawMarkerLine function (see below). The following (setLabel) does
>>> not work (this error:
>>> Can't find method
>>> org.eclipse.birt.chart.model.component.impl.MarkerLineImpl.s etLabel(string).
>>>
>>> at line 19 of chart script:'')
>>>
>>> Perhaps anybody can give me a hint. thanks.
>>>
>>>
>>> function beforeDrawMarkerLine(axis, markerLine, icsc)
>>> {
>>> importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
>>> var min_value =
>>> icsc.getExternalContext().getScriptable().getPersistentGloba lVariable( "min_val");
>>>
>>> markerLine.setValue(NumberDataElementImpl.create(min_value)) ;
>>>
>>> markerLine.setLabel("Value: " + min_value);
>>> }
>>
>
Previous Topic:Multi Value Rows
Next Topic:myeclipse reporting issue
Goto Forum:
  


Current Time: Fri Apr 19 01:35:07 GMT 2024

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

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

Back to the top