On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.

Defined Colors in Charts

Donatus
Donatus Junior Member
Hi,

perhaps somebody can support me.

I would like to make a Pie-Chart with defined Colors for the Categories i.e.
the Categories are States: US is always blue - Spain is always green ...
The Color matching should also be implented via die Datasource.
Is that possible with BIRT?

Thanks.

Comments

  • Virgil
    Virgil Administrator EM admin
    edited 1969 31 #2
    Hi Donatus,

    The colors of the pie pieces can be set with script. Try something like:

    function beforeDrawDataPoint(dph, fill, icsc)
    {

    if (dph.getBaseDisplayValue().equals("USA")) {
    fill.set(0,0,255)
    } else if (dph.getBaseDisplayValue().equals("Spain")) {
    fill.set(0,255,0)
    }
    }