Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic Markerline on X Axis
AlanC
I have a chart with an X-Axis that consists of a series of dates.
I want to put a vertical markerline on the x-axis at a point that will depend on the contents of a dataset.
Is this possible?
When I try the following (test) script, no marker line appears.
function beforeGeneration( chart, icsc )
{
importPackage( Packages.org.eclipse.birt.chart.model.component.impl );
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
importPackage( Packages.org.eclipse.birt.chart.util );
var chart = icsc.getChartInstance();
xAxis = chart.getPrimaryBaseAxes()[0];
yAxis = chart.getPrimaryOrthogonalAxis(xAxis);
markerLine = MarkerLineImpl.create(xAxis, DateTimeDataElementImpl.create(new CDateTime(2010, 12, 27)));
markerLine.getLineAttributes().getColor().set(0,0,255);
markerLine.getLabel().getCaption().setValue("On Caseload");
xAxis.getMarkerLines().add(markerLine);
}
Can anyone suggest a solution?
Thanks
Find more posts tagged with
Comments
mwilliams
Maybe this example from the devShare will help. If not, let me know I'll look at it more closely!
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1158-setting-marker-line-based-on-date-parameter/
AlanC
Michael
Thanks for the advice. I've been on Annual Leave for the last week, which is why I haven't tried it earlier. Unfortunately, the BIRT version in the example is 3.2.20 and our version is 3.2.17 (Build <2.3.2.v20081204-1200>) and I don't know how to convert the example for use in our version.
Do you have any advice for this?
Thanks
Alan
mwilliams
You can try going to the XML Source of the example and replacing the first few lines of version info with the version info from your version and it should open. Let me know.
AlanC
Hi Michael
Unfortunately, this does not work for me. When I try to save the file after changing the top few lines, I get an error message ("Save Failed, java.lang.NullPointerException" - see attached file) and the file is not saved. It also does not allow me to run the report.
Alan