Highlight chart depending on value in the row

hubba900
edited February 11, 2022 in Analytics #1
<p>Hello,</p>
<p> </p>
<p>I know how I can highlight chart depending on a value in same row on chart. For example:</p>
<pre class="_prettyXprint _lang-js">
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);
}
}
}
</pre>
<p>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?</p>
<p> </p>

Comments

  • Clement Wong
    Clement Wong E mod
    edited August 3, 2017 #2
    <p>I'm sorry, but I'm confused by the explanation in the paragraph after your code.</p>
    <p> </p>
    <p>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?</p>
    <p> </p>
    <p>What does your data look like?  Your table and a few lines of sample data will help us understand your requirements.</p>
    <p> </p>
    <p>BTW, what version of BIRT are you using?  Open source, or commercial?</p>
    Warning No formatter is installed for the format ipb
  • <p>I have this chart (look to the external link): <a data-ipb='nomediaparse' href='https://yadi.sk/i/LI8OTNMc3Lhdi5'>https://yadi.sk/i/LI8OTNMc3Lhdi5</a></p&gt;
    <p>I want to highlight some bars depending on the row["C"]. Row["C"] is not present on the chart.</p>
  • Clement Wong
    Clement Wong E mod
    edited August 7, 2017 #4
    <p>It looks like you are using open source BIRT based on the the screenshot?  If so, what version?</p>
    <p> </p>
    <p>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.</p>
    <p> </p>
    <p>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?</p>
    Warning No formatter is installed for the format ipb
  • <p>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.</p>
    <p> </p>
    <p>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. </p>
    <p> </p>
    <p>In my first post - highlights depending on value at bar. I want depending or value in row["C"]. </p>