Skip to main content



      Home
Home » Archived » BIRT » Set label of marker in a chart
Set label of marker in a chart [message #648738] Fri, 14 January 2011 06:00 Go to next message
Eclipse UserFriend
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 11:27 Go to previous messageGo to next message
Eclipse UserFriend
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 13:34 Go to previous messageGo to next message
Eclipse UserFriend
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 13:32 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 12:24:24 EDT 2025

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

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

Back to the top