Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Setting Y-Axis Title from persistent global variable
Setting Y-Axis Title from persistent global variable [message #976800] Thu, 08 November 2012 16:38 Go to next message
Olly   is currently offline Olly
Messages: 61
Registered: June 2010
Location: Florida
Member
I have a graph in a table. One of the detail rows is the column "Units". I have a persistent global variable name "Y_AXIS_UNITS". I set it onRender for that row. It works b/c I used it incorrectly to set the labels. I was using the method beforeDrawAxisLabel. Now I am using beforeDrawAxisTitle and I am trying to set the Y Axis Title to "Value <Units Value>". The problem is that normally to get the global variable I would normally use the following code:
value = context.getExternalContext().getScriptable().getPersistentGlobalVariable("Y_AXIS_UNITS")
However, the last method, getPersistentGlobalVariable is not available to me through icsc. How can I get this value and set the title? I have the following code:
beforeDrawAxisTitle( axis, label, icsc )
{
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
   if(axis.getType() == AxisType.LINEAR_LITERAL)
   {
        label.getCaption().setValue("Units go here");
   }
}
Re: Setting Y-Axis Title from persistent global variable [message #976807 is a reply to message #976800] Thu, 08 November 2012 16:43 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1546
Registered: July 2009
Senior Member

It doesn't show it, but it's there.

icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("varName"); should still get you what you're wanting.


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Setting Y-Axis Title from persistent global variable [message #976817 is a reply to message #976807] Thu, 08 November 2012 16:52 Go to previous messageGo to next message
Olly   is currently offline Olly
Messages: 61
Registered: June 2010
Location: Florida
Member
Thank you. That was correct, it worked.
Re: Setting Y-Axis Title from persistent global variable [message #982369 is a reply to message #976817] Mon, 12 November 2012 23:50 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1546
Registered: July 2009
Senior Member

You're welcome!

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:BIRT and .dll files
Next Topic:A single page Birt report viewer
Goto Forum:
  


Current Time: Tue Jul 29 11:04:24 EDT 2014

Powered by FUDForum. Page generated in 0.02682 seconds