issues with PDF emitter & scripted Series colors

Brian1
edited February 11, 2022 in Analytics #1
Hi,
I have 2 reports, 1 bubble chart the other a 1 bar graph.
In these 2 reports, I am setting the color of the Series via scripting.

When I render these reports in HTML, they look perfect.

When I render these reports in PDF, the Series colors are all blue (my default color), which tells me that my scripting was not executed.

Does the PDF emitter also execute the chart scripting? or is chart scripting only available within the HTML emitter?

I haven't tried Word or Powerpoint yet, so I don't know if they also have the same problem.

Has anyone else seen anything like this?

Thanks!
-Brian

Comments

  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #2
    Hi Brian,

    What version of BIRT are you using? In my simple testing with BIRT 2.2.1, I was able to modify the series lineattributes, as well as change the color for individual datapoints in a line chart and these changes also carried out into the PDF. Since you said you are changing the series color, are you doing this by adding a color to the series pallette in script? Can you upload an example of what you are trying?
    Warning No formatter is installed for the format ipb
  • Brian1
    edited December 31, 1969 #3
    I am using the RCP Designer & the Tomcat Viewer Servlet for BIRT 2.2.1.1.

    In the chart scripting for my Bar Chart, I have the following:

    function beforeDrawDataPoint( dph, fill, context )
    {
    rct = context.getExternalContext();
    rc = rct.getObject();

    //...code to get the value from the .getGlobalVariable() ...

    //Blue Color
    if (target == 0)
    fill.set(0,0,255);

    //Green
    else if( target < 25 )
    fill.set(0, 128, 64);

    //Red
    else if( target > 75)
    fill.set(255, 0,0 );

    //Yellow
    else
    fill.set(255, 255, 0 );
    }

    I have done this type of scripting also in my bubble chart, which gives me the same coloring issue with HTML & PDF.

    There are 2 files attached.
    HTML.PNG is an example of the HTML output of 3 stacked bars.
    In the HTML output you'll see a mix of blue & red colors.

    PDF.PNG is an example of the PDF output of the same 3 stacked bars
    In the PDF output you'll see all red colors.

    Thanks for your help, Virgil!
    -Brian
  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #4
    Hi Brian,

    The version that I created seems to work even out to PDF. Can you try this one and see if you are still seeing a problem? It works from ClassisModels sample database. I tried straigt to PDF and through the Viewer | Export to PDF and the scripting was getting applied each time.
    Warning No formatter is installed for the format ipb