Highlight chart depending on value in the row

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?


 


Comments

  • edited August 3

    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

  • 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.


  • edited August 7

    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

  • 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"]. 


Sign In or Register to comment.