Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Birt chart palette scripting issue(accessing dataset items)
Birt chart palette scripting issue [message #759074] Fri, 25 November 2011 23:21 Go to next message
Arif  is currently offline Arif Friend
Messages: 1
Registered: November 2011
Junior Member
Hello All,

I want to change the scattergraph points color based on a column that is not being used on the x/y axis of the plot. How can i access that column from the data set in palette script. I have tried row["vehicle_count"] but it gives an error that row is not defined. I assumed that it will work like it works in expression builder. Can someone please tell me how do i access this data element(column)

function beforeDrawDataPoint(dph, fill, icsc)
{
//Fill implements Fill interface 
//ImageImpl
//ColorDefinitionImpl
//GradientImpl
//MultipleFillImpl
//EmbeddedImageImpl
//PatternImageImpl

importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
val = dph.getOrthogonalValue();
 if( fill.getClass().isAssignableFrom(ColorDefinitionImpl)){
  if (row["vehicles_count"]>2){
        fill.set(255, 0, 0);
  }
 }
}




Br
Arif
Re: Birt chart palette scripting issue [message #759508 is a reply to message #759074] Mon, 28 November 2011 20:31 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Currently it does not have access to the other datapoints. You could
add a hidden table above the chart and load up a java array list using
the oncreate script that would allow you to access the other columns in
chart script. I used a similar example to get aggregated data for a pie
chart. Take a look at the attached example.

Jason

On 11/25/2011 6:21 PM, Arif wrote:
> Hello All,
>
> I want to change the scattergraph points color based on a column that is
> not being used on the x/y axis of the plot. How can i access that column
> from the data set in palette script. I have tried row["vehicle_count"]
> but it gives an error that row is not defined. I assumed that it will
> work like it works in expression builder. Can someone please tell me how
> do i access this data element(column)
>
>
> function beforeDrawDataPoint(dph, fill, icsc)
> {
> //Fill implements Fill interface //ImageImpl
> //ColorDefinitionImpl
> //GradientImpl
> //MultipleFillImpl
> //EmbeddedImageImpl
> //PatternImageImpl
>
> importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
> val = dph.getOrthogonalValue();
> if( fill.getClass().isAssignableFrom(ColorDefinitionImpl)){
> if (row["vehicles_count"]>2){
> fill.set(255, 0, 0);
> }
> }
> }
>
>
>
>
> Br
> Arif
Previous Topic:How to Include ReportViewer as a portlet
Next Topic:Making of autocomplete anket
Goto Forum:
  


Current Time: Fri Apr 19 06:13:53 GMT 2024

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

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

Back to the top