Results 1 to 2 of 2

Thread: How to change the chart colors in Sugar Dashboard

  1. #1
    anandece1 is offline Member
    Join Date
    Apr 2010
    Posts
    6

    Smile How to change the chart colors in Sugar Dashboard

    hi, i want to change the field values color in sugar dash board. Say now in the Outcome by month dashlet, the color of order won is represented by orange color and tender by green and etc.... Now i need to change the color of these fields as per my wish .. How can i do this in Sugarcrm CE 5.2 ?

  2. #2
    kenneth.thorman is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    191

    Default Re: How to change the chart colors in Sugar Dashboard

    You will have to take control over the XML file generation.

    modules\Charts\Dashlets\OutcomeByMonthDashlet\Outc omeByMonthDashlet.php

    inherits

    include\Dashlets\DashletGenericChart.php

    and uses

    include\SugarCharts\SugarChart.php to generate the XML


    PHP Code:
        function xmlProperties(){    
            
    // open the properties tag
            
    $properties $this->tab("<properties>",1);
            
            
    // grab the property and value from the chart_properties variable
            
    foreach ($this->chart_properties as $key => $value){
                
    $properties .= $this->tab("<$key>$value</$key>",2);
            }
            
            if (!empty(
    $this->colors_list)){
                
    // open the colors tag
                
    $properties .= $this->tab("<colors>",2);
                foreach (
    $this->colors_list as $color){
                    
    $properties .= $this->tab("<color>$color</color>",3);
                }
                
                
    // close the colors tag
                
    $properties .= $this->tab("</colors>",2);
            }
            
            
    // close the properties tag
            
    $properties .= $this->tab("</properties>",1);
            
            return 
    $properties;
        } 
    I am not sure that you can force a specific color for a specific value in the charts as it is today, you might have to do some changes to the code

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change Charts Colors
    By Mars in forum Help
    Replies: 9
    Last Post: 2012-01-24, 04:11 AM
  2. Replies: 2
    Last Post: 2011-05-16, 05:32 PM
  3. Change Colors of the Checkboxes
    By Danielg42 in forum Developer Help
    Replies: 3
    Last Post: 2008-11-24, 07:16 PM
  4. Dashboard Chart Addon
    By steele87 in forum General Discussion
    Replies: 2
    Last Post: 2008-08-13, 06:17 PM
  5. Dashboard chart in sugarcrm 4.0
    By wadii in forum General Discussion
    Replies: 5
    Last Post: 2006-01-12, 08:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •