[rt-users] How to change the color order of RT internal Reporting Functions

Brumm, Torsten / Kuehne + Nagel / Ham MI-ID torsten.brumm at Kuehne-Nagel.com
Thu May 6 07:58:47 EDT 2010


Hi Emmanuel,
just in the moment i pressed Send i found this ($chart->set( dclrs => [ qw(green pink blue cyan) ] ); )also inside GD::Graph Module :-(

But thanks

Torsten 


Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius, Reiner Heiken, Bruno Mang, Alfred Manke, Christian Marnetté, Mark Reinhardt, Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael Kuehne



-----Urspruengliche Nachricht-----
Von: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] Im Auftrag von Emmanuel Lacour
Gesendet: Donnerstag, 6. Mai 2010 13:52
An: rt-users at lists.bestpractical.com
Betreff: Re: [rt-users] How to change the color order of RT internal Reporting Functions

On Thu, May 06, 2010 at 01:45:52PM +0200, Brumm, Torsten / Kuehne + Nagel / Ham MI-ID wrote:
> Hi,
> i'm searching since some days for a way to change the RT Reports Colors for PIE Charts. 
> 
> RT uses the colors in order: red, green, yellow, blue etc but i don't like to start with red.
> 
> Where can i find some hints?!?
> 
> Looked already inside Search/Chart.html and Search/Chart also Search/Elements/Chart but there is nothing like this.
> 

look in RT 3.8.8 in rt/share/html/Search/Chart, colors where changed for
3.8.8:

# refine values' colors, with both Color::Scheme's help and my own tweak $chart->{dclrs} = [
    '66cc66', 'ff6666', 'ffcc66', '663399',
    '3333cc',
    '339933', '993333', '996633', '663399',
    '33cc33', 'cc3333', 'cc9933', '6633cc'
];

{
    no warnings 'redefine';
    *GD::Graph::pick_data_clr = sub {
        my $self      = shift;
        my $color_hex = $self->{dclrs}[ $_[0] % @{ $self->{dclrs} } - 1 ];
        return map { hex } ( $color_hex =~ /(..)(..)(..)/ );
    };
}


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com




More information about the rt-users mailing list