Hi Dave.  The answer is a teeny bit complex.

Each Series (except the pieSeries) has a style property called 'fill' that
it pulls its fill from.  So what you're wondering is: how do I specify the
fill style for each series that appears in my chart?

Each chart type, when it displays its series, assigns a CSS style selector
to each series. In order to guarantee that each series gets a different
fill, it assigns a different selector to each series, by index. 

The names of the selectors the chart assigns are, in turn, specified in a
style property of the chart, called chartSeriesStyles.

So if you want to specify the fills to be used by ColumnCharts, you could do
it like this:

<mx:Style>

        .customColumnSeries1 {
                fill: #FF0000;
        }
        .customColumnSeries2 {
                fill: #00FF00;
        }
        .customColumnSeries3 {
                fill: #0000FF;
        }

        ColumnChart { 
                chartSeriesStyles: customColumnSeries1, customColumnSeries2,
customColumnSeries3;
        }
</mx:Style>

PieCharts work a little differently. Since each pie series needs more that
one fill (one for each wedge), the pieSeries draw its fills from a property
called fills. You can specify this in CSS as well:

<mx:Style>

PieSeries {
        Fills: #Ff0000, #00FF00, #0000FF;
}
</mx:Style>

Now there's a little bit of handwaving going on here.  The reason is, the
fill properties of the charts aren't really rgb hex values, they are fill
objects. We made them fill objects so that you could fill a chart with other
fill types -- gradients, etc.  

However, CSS doesn't support a syntax for specifying an object.  Which means
there's really no way to specify a Fill object -- SolidColor,
LinearGradient, etc. -- in CSS.  If you want to specify a complex fill type,
you need to either do it on a per-component basis, or set the style through
actionscript.

But, since there _is_ a way to specify simple color values in CSS, and
that's what most designers typically want to do, we provided a shortcut.
When the charts render themselves, if they find a simple RGB value in their
fill or fills properties, they'll convert them to a SolidColor on the fly.
Hence, the above CSS markup will work.

Ely.



-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dave
Sent: Thursday, May 19, 2005 2:17 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Default Chart Colors
Importance: High

How do I change the default colors used by Flex for multiple charts? 
As charts are added, the Legend and the Chart itself follow a pattern 
of predetermined colors.

Where is that defined? I need to change site wide.


Thanks much,

-Dave




 
Yahoo! Groups Links



 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to