Jump to content

BIRT Developer Center Download


Photo
- - - - -

Highlight chart depending on value in the row

highlight chart rcp design

  • Please log in to reply
5 replies to this topic

#1 hubba900

hubba900

    Member

  • Members
  • PipPip
  • 11 posts

Posted 03 August 2017 - 04:07 AM

Hello,

 

I know how I can highlight chart depending on a value in same row on chart. For example:

function beforeDrawDataPoint(dph, fill, icsc)
{

importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
val = dph.getOrthogonalValue();
 if( fill.getClass().isAssignableFrom(ColorDefinitionImpl)){
  if (val >= 500 && val < 1000){
        fill.set(255, 255, 0);
  }
  if (val >= 1000){
        fill.set(255, 0, 0);
  }
 }
}

How I can highlight chart if a value what I want use is not use in chart, but it is value from the same data binding? For example, I use row["A"] to X and row["B"] to Y and I also has row["C"] what I don't use to chart. How I can highlight X to yellow if value in row["C"] will between 5 and 7 and X to red if value in row["C"] will greater or equal then 7?

 



#2 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1204 posts

Posted 03 August 2017 - 03:17 PM

I'm sorry, but I'm confused by the explanation in the paragraph after your code.

 

Do you have a sample .rptdesign that you can attach (perhaps using the sample Classic Models database) as a starting point of what you are trying to accomplish?

 

What does your data look like?  Your table and a few lines of sample data will help us understand your requirements.

 

BTW, what version of BIRT are you using?  Open source, or commercial?


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#3 hubba900

hubba900

    Member

  • Members
  • PipPip
  • 11 posts

Posted 03 August 2017 - 10:54 PM

I have this chart (look to the external link): https://yadi.sk/i/LI8OTNMc3Lhdi5

I want to highlight some bars depending on the row["C"]. Row["C"] is not present on the chart.



#4 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1204 posts

Posted 07 August 2017 - 03:31 PM

It looks like you are using open source BIRT based on the the screenshot?  If so, what version?

 

Are you able to provide sample data?  That way it could match your requirements, instead of me manufacturing/creating dummy data that might not meet your needs.

 

And to double check, did you want some of those blue bars, that meet the requirements for row["C"] to be a different color like red or yellow.  Will that be sufficient as your highlights?


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#5 hubba900

hubba900

    Member

  • Members
  • PipPip
  • 11 posts

Posted 08 August 2017 - 09:56 AM

I use Eclipse BIRT Designer Version 4.7.0.v201706222054. I'm sorry, I can't share template. This is a regular Grantt chart with Y: Series 1 (Start Date and End Date, Task label - static value), X - Start Time.

 

I just want to colorize chart depending on value on row["C"]. If row["C"] will equal or greater then 5 - bar should be yellow, if row["C"] will equal or greater then 7 - bar should be red. The row["C"] is another row doesn't use in chart, but located in the same Data. 

 

In my first post - highlights depending on value at bar. I want depending or value in row["C"]. 



#6 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1204 posts

Posted 25 August 2017 - 03:20 PM

Have you seen this older Gantt chart post?

http://developer.act...alues/?p=142193


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com






Also tagged with one or more of these keywords: highlight, chart, rcp, design