Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Y-axis label above the axis?
BinkoBinev
Hi all,
I am completetyl new to Birt and my question may sound really stupid.
I would like to out an axis label for the y axis not to the left or right but above it.
Like
?C
|
|
|
date
So how can I put these labels - above the y axis?
Thank you for your kind help.
Find more posts tagged with
Comments
mwilliams
Are you talking about the axis titles? Or the actual value labels?
Let me know.
BinkoBinev
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="99215" data-time="1334701537" data-date="17 April 2012 - 03:25 PM"><p>
Are you talking about the axis titles? Or the actual value labels?<br />
<br />
Let me know.<br /></p></blockquote>
<br />
I mean axis title - I have tried to visualize it - I want to set the ?C label above the y axis, nopt to the left or right of it, ot at least to rotate it. Because in the designer it is just rotated 90?.<br />
<br />
I would also like to be able to dynamically insert graphics in the report - the user makes a list of certain parameters - and based on the list a set of graphics should be inserted in the report.<br />
<br />
Any suggestions how this can be done? <br />
I moved today from the designer to the report engine but could not set it somehow. Tomorrow will try with the webexamplereport from the birt-runtime zip.<br />
<br />
Thanks for your answer. Hope I have not misused your kindness.
mwilliams
You can set the inset points for the axis title and get it to be at the end of the axis, but it won't be on top of or next to it. I haven't been able to get it to do that with some quick testing.
As far as the dynamic images goes. Can you be more specific in what you're trying to do with that?
BinkoBinev
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="99281" data-time="1334784115" data-date="18 April 2012 - 02:21 PM"><p>
You can set the inset points for the axis title and get it to be at the end of the axis, but it won't be on top of or next to it. I haven't been able to get it to do that with some quick testing.<br />
<br />
As far as the dynamic images goes. Can you be more specific in what you're trying to do with that?<br /></p></blockquote>
<br />
1. About the dynamic charts:<br />
The user selects the charts he wants to see in the report. So I do not know now what charts he wants to use. <br />
I get an ArrayList<ChartData><br />
<br />
where ChartData cd = new ChartData(ArrayList xValues, ArrayList yvalues, String xtitle, String ytitle);<br />
<br />
So the user chooses the 4 arguments and adds the chart data to the list.<br />
<br />
This list should be represented in the report. I cannot set dummy charts as I do not know what the user will select.<br />
<br />
I hope I have convey the genral ides of what I intend.<br />
<br />
Right now I have still problems with starting the OSGI framework. <br />
<br />
I use a class from the birt examples SimpleCreate<br />
<br />
package scomreport.charts;<br />
<br />
import java.io.IOException;<br />
<br />
import org.eclipse.birt.core.framework.Platform;<br />
import org.eclipse.birt.report.model.api.CellHandle;<br />
import org.eclipse.birt.report.model.api.DesignConfig;<br />
import org.eclipse.birt.report.model.api.DesignElementHandle;<br />
import org.eclipse.birt.report.model.api.ElementFactory;<br />
import org.eclipse.birt.report.model.api.GridHandle;<br />
import org.eclipse.birt.report.model.api.IDesignEngine;<br />
import org.eclipse.birt.report.model.api.IDesignEngineFactory;<br />
import org.eclipse.birt.report.model.api.ImageHandle;<br />
import org.eclipse.birt.report.model.api.LabelHandle;<br />
import org.eclipse.birt.report.model.api.ReportDesignHandle;<br />
import org.eclipse.birt.report.model.api.RowHandle;<br />
import org.eclipse.birt.report.model.api.SessionHandle;<br />
import org.eclipse.birt.report.model.api.activity.SemanticException; <br />
<br />
import com.ibm.icu.util.ULocale;<br />
<br />
/**<br />
* Simple BIRT Design Engine API (DEAPI) demo.<br />
*/<br />
<br />
public class SimpleCreate<br />
{<br />
<br />
public static void main( String[] args )<br />
{<br />
try<br />
{<br />
buildReport( );<br />
}<br />
catch ( IOException e )<br />
{<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
}<br />
catch ( SemanticException e )<br />
{<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
}<br />
}<br />
<br />
// This function shows how to build a very simple BIRT report with a<br />
// minimal set of content: a simple grid with an image and a label.<br />
<br />
static void buildReport( ) throws IOException, SemanticException<br />
{<br />
// Create a session handle. This is used to manage all open designs.<br />
// Your app need create the session only once.<br />
<br />
//Configure the Engine and start the Platform <br />
DesignConfig config = new DesignConfig( );<br />
<br />
config.setProperty("BIRT_HOME", "C:/prg/birt-runtime-3_7_2/ReportEngine");<br />
IDesignEngine engine = null;<br />
try{<br />
<br />
<br />
Platform.startup( config );<br />
IDesignEngineFactory factory = (IDesignEngineFactory) Platform<br />
.createFactoryObject( IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY );<br />
engine = factory.createDesignEngine( config );<br />
<br />
}catch( Exception ex){<br />
ex.printStackTrace();<br />
} <br />
<br />
<br />
SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH ) ;<br />
<br />
// Create a new report design.<br />
<br />
ReportDesignHandle design = session.createDesign( );<br />
<br />
// The element factory creates instances of the various BIRT elements.<br />
<br />
ElementFactory efactory = design.getElementFactory( );<br />
<br />
// Create a simple master page that describes how the report will<br />
// appear when printed.<br />
//<br />
// Note: The report will fail to load in the BIRT designer<br />
// unless you create a master page.<br />
<br />
DesignElementHandle element = efactory.newSimpleMasterPage( "Page Master" ); <br />
design.getMasterPages( ).add( element );<br />
<br />
// Create a grid and add it to the "body" slot of the report<br />
// design.<br />
<br />
GridHandle grid = efactory.newGridItem( null, 2 /* cols */, 1 /* row */ );<br />
design.getBody( ).add( grid );<br />
<br />
// Note: Set the table width to 100% to prevent the label<br />
// from appearing too narrow in the layout view.<br />
<br />
grid.setWidth( "100%" ); <br />
<br />
// Get the first row.<br />
<br />
RowHandle row = (RowHandle) grid.getRows( ).get( 0 );<br />
<br />
// Create an image and add it to the first cell.<br />
ImageHandle image = efactory.newImage( null );<br />
CellHandle cell = (CellHandle) row.getCells( ).get( 0 );<br />
cell.getContent( ).add( image );<br />
image.setURL( "\"urlofimage\"" ); <br />
<br />
// Create a label and add it to the second cell.<br />
LabelHandle label = efactory.newLabel( null );<br />
cell = (CellHandle) row.getCells( ).get( 1 );<br />
cell.getContent( ).add( label );<br />
label.setText( "Hello, world!" ); <br />
<br />
// Save the design and close it.<br />
<br />
design.saveAs( "c:/tmp/sample.rptdesign" ); <br />
design.close( );<br />
System.out.println("Finished");<br />
<br />
// We're done!<br />
}<br />
}<br />
<br />
but get the exception<br />
<br />
org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI framework<br />
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:91)<br />
at scomreport.charts.SimpleCreate.buildReport(SimpleCreate.java:63)<br />
at scomreport.charts.SimpleCreate.main(SimpleCreate.java:33)<br />
Caused by: org.eclipse.birt.core.exception.CoreException<br />
at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OSGILauncher.java:90)<br />
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:79)<br />
... 2 more<br />
<br />
I just do not know what is the problem as this is a Birt example, and it should actually work.<br />
<br />
Thank you for your kind help
mwilliams
Take out the BIRT HOME part. With 3.7, you shouldn't need to set the BIRT home. You just need to make sure all the necessary jars are in your build/class path.
Take a look at this:
http://wiki.eclipse.org/Birt_3.7_Migration_Guide
mwilliams
So, the dynamic "graphics" you're wanting to put in the report are charts? Not just images? The user just inputs the x and y values and the axis titles and you want a chart to be made out of this? Is there only one chart they can create the values for? Or are there multiple? You should be able to take their inputs and create a scripted dataSet to use for your chart, if it's just one chart.
BinkoBinev
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="99330" data-time="1334855467" data-date="19 April 2012 - 10:11 AM"><p>
So, the dynamic "graphics" you're wanting to put in the report are charts? Not just images? The user just inputs the x and y values and the axis titles and you want a chart to be made out of this? Is there only one chart they can create the values for? Or are there multiple? You should be able to take their inputs and create a scripted dataSet to use for your chart, if it's just one chart.<br /></p></blockquote>
<br />
Ther are multiple charts - the user has to dcide which data should be represented in the report.<br />
Yes, I use scripted datasets and they are also dynamically generated.<br />
<br />
Quite advanced undertaking for a newbie like me, but I just have to fulfil requirements.<br />
<br />
Also birt has to be integrated as a plug-in rcp and right now, I get a message:<br />
<br />
org.eclipse.birt.report.engine.api.EngineException: No such script extension : javascript.<br />
<br />
I added the org.eclipse.birt.report.engine.script.javascript;bundle-version="3.7.2" plug-in as a dependency plug-in , but the exception persists.<br />
<br />
quite a bit of problems right now, and already tired - 10 hours on the job
<br />
<br />
Thank for your answers
mwilliams
Can you post the entire error stack?
BinkoBinev
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="99407" data-time="1334861471" data-date="19 April 2012 - 11:51 AM"><p>
Can you post the entire error stack?<br /></p></blockquote>
<br />
Right now is that javascript cannot be recognized when I run the rcp application. It shows only the "hardcoded" images and text.<br />
The dynamic content should come from a class GeneralData.<br />
<br />
Wrapped org.eclipse.birt.report.model.api.extension.ExtendedElementException: Error.SemanticError.EXTENSION_NOT_FOUND (/report/method[
@name="
;beforeFactory"]#47)<br />
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:244)<br />
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleBeforeFactory(ReportScriptExecutor.java:122)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask.startFactory(EngineTask.java:1915)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:100)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)<br />
at scomreport.View.previewReport(View.java:101)<br />
at scomreport.View.createPartControl(View.java:36)<br />
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:375)<br />
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229)<br />
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)<br />
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)<br />
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:534)<br />
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)<br />
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)<br />
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)<br />
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)<br />
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)<br />
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)<br />
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)<br />
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:643)<br />
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:570)<br />
at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:568)<br />
at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:272)<br />
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:981)<br />
at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:2714)<br />
at org.eclipse.ui.internal.WorkbenchWindow$28.run(WorkbenchWindow.java:3030)<br />
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)<br />
at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:3011)<br />
at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:799)<br />
at org.eclipse.ui.internal.Workbench$23.runWithException(Workbench.java:1229)<br />
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)<br />
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)<br />
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)<br />
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)<br />
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)<br />
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)<br />
at org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1600)<br />
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)<br />
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)<br />
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)<br />
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4683)<br />
at org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:94)<br />
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1595)<br />
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2628)<br />
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)<br />
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)<br />
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)<br />
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)<br />
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)<br />
at scomreport.Application.start(Application.java:20)<br />
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)<br />
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)<br />
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)<br />
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)<br />
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
at java.lang.reflect.Method.invoke(Method.java:601)<br />
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)<br />
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)<br />
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)<br />
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)<br />
Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "
mwilliams
Can you show me what your beforeFactory script is?