|
Re: Gantt chart height [message #367121 is a reply to message #367113] |
Thu, 19 February 2009 15:58 |
Eclipse User |
|
|
|
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 #367135 is a reply to message #367130] |
Fri, 20 February 2009 15:12 |
Eclipse User |
|
|
|
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
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03659 seconds