|
Re: Set label of marker in a chart [message #648832 is a reply to message #648738] |
Fri, 14 January 2011 16:27 |
|
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 |
Klaus Meisl 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 |
|
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);
>>> }
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02038 seconds