Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Gantt chart height
Gantt chart height [message #367113] Thu, 19 February 2009 08:01 Go to next message
Tadej is currently offline TadejFriend
Messages: 20
Registered: July 2009
Junior Member
Hello

I'm having a problem in gantt chart, I'd like to set the height dynamicly
to match the lines in the dataset, so, if in the dataset are 4 rows, the
height schould be 200px, or each row of the dataset, schould increase the
height 50px

tried this but doesnt work somehow (birt 2.2.2)


function beforeGeneration(chart, icsc)
{
importPackage(Packages.org.eclipse.birt.chart.model.type.imp l);
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
importPackage( Packages.org.eclipse.birt.chart.util );

xAxis = chart.getBaseAxes()[0];
yAxis = chart.getOrthogonalAxes( xAxis, true)[0]

seriesDef = yAxis.getSeriesDefinitions().get(0);
runSeries = seriesDef.getRunTimeSeries()[0];
//Retrieve list of data values
list = runSeries.getDataSet().getValues();
visina=list.length;
visina=visina*35;
chart.getBlock().getBounds().setHeight(visina);
chart.getTitle().getLabel().getCaption().setValue(visina);
}
Re: Gantt chart height [message #367121 is a reply to message #367113] Thu, 19 February 2009 15:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Take a look at this link:
http://birtworld.blogspot.com/2008/04/birt-resizing-charts.h tml

Jason

Tadej wrote:
> Hello
>
> I'm having a problem in gantt chart, I'd like to set the height
> dynamicly to match the lines in the dataset, so, if in the dataset are 4
> rows, the height schould be 200px, or each row of the dataset, schould
> increase the height 50px
>
> tried this but doesnt work somehow (birt 2.2.2)
>
>
> function beforeGeneration(chart, icsc)
> {
> importPackage(Packages.org.eclipse.birt.chart.model.type.imp l);
> importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
> importPackage( Packages.org.eclipse.birt.chart.util );
>
> xAxis = chart.getBaseAxes()[0];
> yAxis = chart.getOrthogonalAxes( xAxis, true)[0]
>
> seriesDef = yAxis.getSeriesDefinitions().get(0);
> runSeries = seriesDef.getRunTimeSeries()[0];
> //Retrieve list of data values
> list = runSeries.getDataSet().getValues();
> visina=list.length;
> visina=visina*35;
> chart.getBlock().getBounds().setHeight(visina);
> chart.getTitle().getLabel().getCaption().setValue(visina);
> }
>
>
Re: Gantt chart height [message #367130 is a reply to message #367121] Fri, 20 February 2009 07:27 Go to previous messageGo to next message
Tadej is currently offline TadejFriend
Messages: 20
Registered: July 2009
Junior Member
I allready looked this up, and made my source code with help of this
topic, but as mentioned the chart doesn't resize, the value for resizing
(visina) gets calculated just fine, but doesn't affect the chart.

thanks
Re: Gantt chart height [message #367135 is a reply to message #367130] Fri, 20 February 2009 15:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

If you are using 2.2.2
Did you do this in the beforeFactory?
var mychart = this.getReportElement( "mychart"
);mychart.setWidth("");mychart.setHeight("");

And have you tried the script in the afterDataSetFilled?
function afterDataSetFilled(series, dataSet, icsc){if(
series.getSeriesIdentifier() == "seriesone" ){if(
dataSet.getValues().length > 4 ){
icsc.getChartInstance().getBlock().getBounds().setWidth(800) ;
icsc.getChartInstance().getBlock().getBounds().setHeight(600 );}else{
icsc.getChartInstance().getBlock().getBounds().setWidth(400) ;
icsc.getChartInstance().getBlock().getBounds().setHeight(300 );}}}


2.3 should allow you to do it in the beforeGeneration.

Jason


Tadej wrote:
> I allready looked this up, and made my source code with help of this
> topic, but as mentioned the chart doesn't resize, the value for resizing
> (visina) gets calculated just fine, but doesn't affect the chart.
>
> thanks
>
Re: Gantt chart height [message #367147 is a reply to message #367135] Mon, 23 February 2009 08:56 Go to previous messageGo to next message
Tadej is currently offline TadejFriend
Messages: 20
Registered: July 2009
Junior Member
Thank you, in a hurry I overlooked the beforeFactory, changed that and it
works just great
thank you very much

Best regards Tadej
Re: Gantt chart height [message #540632 is a reply to message #367113] Wed, 16 June 2010 18:44 Go to previous message
Rajeev  is currently offline Rajeev Friend
Messages: 2
Registered: April 2010
Junior Member
Hi,

I am facing the same issue with the Gantt height and when I try to export to PDF it totally loses its alignment.

Do you find any solution to it.

Thanks
Previous Topic:Fold-Out Tables in a Report (by Categories)
Next Topic:Access project resources from ODA driver Plug-in
Goto Forum:
  


Current Time: Thu Mar 28 18:08:22 GMT 2024

Powered by FUDForum. Page generated in 0.03659 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top