Skip to main content



      Home
Home » Archived » BIRT » How to set a fixed scale on a line chart in birt 2.2.2
How to set a fixed scale on a line chart in birt 2.2.2 [message #368494] Thu, 04 June 2009 09:12 Go to next message
Eclipse UserFriend
Hello, I've got a question that schould be simple for you. I have a line
chart with data for today, but I have a problem, if I look the report at
3:00 PM then the scale max is set to 3:00, but I would like to see the
whole scale, from midnight to midnight

I used a source code from gannt chart which is pasted below:

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 );
importPackage(Packages.java.util);

a1=icsc.getExternalContext().getScriptable().getGlobalVariab le( "a");
b1=icsc.getExternalContext().getScriptable().getGlobalVariab le( "b");
c1=icsc.getExternalContext().getScriptable().getGlobalVariab le( "c");
c2=icsc.getExternalContext().getScriptable().getGlobalVariab le( "c1");

rpctx = icsc.getExternalContext().getScriptable();
xAxis = chart.getBaseAxes()[0];
yAxis = chart.getOrthogonalAxes( xAxis, true)[0]
scale = yAxis.getScale();
scale.setMin( DateTimeDataElementImpl.create( new CDateTime(a1,b1,c1) )
);
scale.setMax( DateTimeDataElementImpl.create( new CDateTime(a1,b1,c2) )
);

seriesDef = yAxis.getSeriesDefinitions().get(0);
runSeries = seriesDef.getRunTimeSeries()[0];
}

but I get error message: INVALID MINIMUM SCALE VALUE 0 SPECIFIED FOR AXIS
TYPE LINEAR



Any idea??

Thanks in advance
Re: How to set a fixed scale on a line chart in birt 2.2.2 [message #368498 is a reply to message #368494] Thu, 04 June 2009 11:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Set the scale on the xaxis not the yaxis.

Jason

Tadej wrote:
> Hello, I've got a question that schould be simple for you. I have a line
> chart with data for today, but I have a problem, if I look the report at
> 3:00 PM then the scale max is set to 3:00, but I would like to see the
> whole scale, from midnight to midnight
>
> I used a source code from gannt chart which is pasted below:
>
> 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 );
> importPackage(Packages.java.util);
>
>
> a1=icsc.getExternalContext().getScriptable().getGlobalVariab le( "a");
>
> b1=icsc.getExternalContext().getScriptable().getGlobalVariab le( "b");
>
> c1=icsc.getExternalContext().getScriptable().getGlobalVariab le( "c");
>
> c2=icsc.getExternalContext().getScriptable().getGlobalVariab le( "c1");
>
> rpctx = icsc.getExternalContext().getScriptable();
> xAxis = chart.getBaseAxes()[0];
> yAxis = chart.getOrthogonalAxes( xAxis, true)[0]
> scale = yAxis.getScale();
> scale.setMin( DateTimeDataElementImpl.create( new
> CDateTime(a1,b1,c1) ) );
> scale.setMax( DateTimeDataElementImpl.create( new
> CDateTime(a1,b1,c2) ) );
>
> seriesDef = yAxis.getSeriesDefinitions().get(0);
> runSeries = seriesDef.getRunTimeSeries()[0];
> }
>
> but I get error message: INVALID MINIMUM SCALE VALUE 0 SPECIFIED FOR
> AXIS TYPE LINEAR
>
>
>
> Any idea??
>
> Thanks in advance
>
>
Re: How to set a fixed scale on a line chart in birt 2.2.2 [message #368504 is a reply to message #368498] Thu, 04 June 2009 13:51 Go to previous message
Eclipse UserFriend
Hi Jason,

Thanks a lot for your help

Be well
Previous Topic:Problem on a Line chart
Next Topic:Sorting a cube
Goto Forum:
  


Current Time: Wed Oct 29 11:51:08 EDT 2025

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

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

Back to the top