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)
Hide Axis Line+ticks/Title + legend with script
sbr
Is it possible to hide the complete axis for a line chart with more axes?<br />
I managed to hide the chart line with following script:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.attribute );
xAxis = chart.getBaseAxes()[0];
yAxis = chart.getOrthogonalAxes( xAxis, true)[2];
if(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("ogid") == 23) {
yAxis.getSeriesDefinitions().remove(0);
yAxis.getLineAttributes().setVisible(false);
yAxis.getMajorGrid().getLineAttributes().setVisible(false);
yAxis.getMinorGrid().getLineAttributes().setVisible(false);
yAxis.getMajorGrid().getTickAttributes().setVisible(false);
yAxis.getLabel().setVisible(false);
yAxis.getScale().getLabel().setVisible(false);
}
}
</pre>
<br />
But i found nothing to hide the axis and the legend.<br />
<br />
Is it possible to hide them too?<br />
<br />
Stefan
Find more posts tagged with
Comments
mwilliams
Here's how you can hide the legend and title in script:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeGeneration( chart, icsc )
{
chart.getTitle().setVisible(false);
chart.getLegend().setVisible(false);
}
</pre>