scaleX had some funky unexpected results. I can show anyone who's interested
at the next meeting.
Using strokes colored white with heavy widths was a good-enough-for-now
hack.

I have another ColumnChart-related question:

I'm lookng for a way to add ColumnSeries to a ColumnChart thru actionscript.
The ColumnChart is in mxml, dataprovider is an ArrayCollection of two
objects, each with three items: a name, and two sets of number data. The
type of the chart is overlaid and there are two series. Thus there are 4
vertical bars in two columns. However, given the data differences, you can
only see 3 of the bars: the 4th bar is behind the 3rd in the 2nd column.
Confusing enough yet? It makes more sense when you see it. (testChart1.mxml)
Anyways, I want to add the ColumnSeries dynamically, in a certain order,
based on the dataprovider's data. (testChart2.mxml) What am I doing wrong
and what is the right way to do this? Also how does one set the fill and
stroke of a columnSeries in actionscript?
Thanks !

===
testChart1.mxml:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
<mx:Script>
<![CDATA[
    import mx.collections.ArrayCollection;

    [Bindable]
    private var medalsAC:ArrayCollection = new ArrayCollection( [
        { Country: "X", Gold: 15, Silver:19},
        { Country: "Y", Gold: 22, Silver:17}]);
]]>
</mx:Script>

    <mx:SolidColor id="sc3" color="black"/>
    <mx:SolidColor id="sc4" color="green"/>

    <mx:Stroke id="s2" color="white" weight="20" alpha="0.1" />
    <mx:Stroke id="s3" color="green" weight="20" />

<mx:TabNavigator height="100%" width="100%">
    <mx:HBox label="new"
        height="100%" width="100%" >
        <mx:ColumnChart
            height="100%" width="100%"
            showDataTips="true" dataProvider="{medalsAC}"
               type="overlaid" >
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="Country"/>
            </mx:horizontalAxis>
            <mx:series>
                <mx:ColumnSeries
                    xField="Country" yField="Silver"
                    displayName="Silver"
                    fill="{sc3}"
                    stroke="{s3}"/>
                <mx:ColumnSeries
                    xField="Country" yField="Gold"
                    displayName="Gold"
                    fill="{sc4}"
                    stroke="{s2}"/>
            </mx:series>
        </mx:ColumnChart>
    </mx:HBox>
</mx:TabNavigator>
</mx:Application>
==================================
testChart2.mxml:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
<mx:Script>
<![CDATA[
    import mx.charts.series.ColumnSeries;
    import mx.charts.chartClasses.Series;
    import mx.collections.ArrayCollection;

    [Bindable]
    private var medalsAC:ArrayCollection = new ArrayCollection( [
        { Country: "X", Gold: 15, Silver:19},
        { Country: "Y", Gold: 22, Silver:17}]);
    private function getSeries():Series{
        var result:Series = new Series();
        var columnSeriesA:ColumnSeries = new ColumnSeries();
        var columnSeriesB:ColumnSeries = new ColumnSeries();
        columnSeriesA.xField="Country";
        columnSeriesA.yField="Silver";
        //columnSeriesA.displayName="Silver";
        //columnSeriesA.fillFunction=sc3;
        //columnSeriesA.stroke=s3;

        columnSeriesB.xField="Country";
        columnSeriesB.yField="Gold";
        //columnSeriesB.displayName="Gold";
        //columnSeriesB.fillFunction=sc4;
        //columnSeriesB.stroke=s2;
        for each (var o:Object in medalsAC){
            if (o.hasOwnProperty("Gold") && o.Gold < o.Silver){
                result.addChildAt(columnSeriesA,0);
                result.addChildAt(columnSeriesB,1);
            }else{
                result.addChildAt(columnSeriesB,0);
                result.addChildAt(columnSeriesA,1);
            }
        }

        return result;
    }

]]>
</mx:Script>

    <mx:SolidColor id="sc3" color="black"/>
    <mx:SolidColor id="sc4" color="green"/>

    <mx:Stroke id="s2" color="white" weight="20" alpha="0.1" />
    <mx:Stroke id="s3" color="green" weight="20" />

<mx:TabNavigator height="100%" width="100%">
    <mx:HBox label="new"
        height="100%" width="100%" >
        <mx:ColumnChart
            height="100%" width="100%"
            showDataTips="true" dataProvider="{medalsAC}"
            series="{this.getSeries() as Array}"
               type="overlaid" >
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="Country"/>
            </mx:horizontalAxis>
        </mx:ColumnChart>
    </mx:HBox>
</mx:TabNavigator>
</mx:Application>

On Fri, Dec 19, 2008 at 9:38 AM, Douglas Knudsen
<[email protected]>wrote:

> I have not done this per se, but would probably look at ChartItemRender
> first.  I'd maybe set up a sample app and a custom renderer and just try a
> random width for the heck of it to see if its possible.  Some of those
> charting properties have a way of not behaving like you'd expect, for
> example, scaleX and Y can be applied by the framework yielding unexpected
> results with regards to width. I've never actually seen a chart example with
> varying column widths.
>
> Another thought, might be able to apply filters/masks and such to make a
> column appear smaller in width.  "Graphics padding"
>
> Douglas Knudsen
> http://www.cubicleman.com
> this is my signature, like it?
>
>
>
> On Fri, Dec 19, 2008 at 9:03 AM, Jason West <[email protected]> wrote:
>
>> Nothing comes to mind on how exactly this could be done without extending
>> the graph class and applying your customizations to it.  I would be
>> interested if anyone else has additional feed back on this subject of
>> customization of the chart APIs that come with the Flex 3 Developer.
>> Thanks
>>
>> Jason L. West
>>
>> http://blog.wezbiz.net
>>
>> /***************************************
>> * One of Einstein's colleagues asked him for his telephone number one day.
>> Einstein reached for
>> * a telephone directory and looked it up. "You don't remember your own
>> number?" the man asked, startled.
>> *
>> * "No," Einstein answered. "Why should I memorize something I can so
>> easily get from a book?"
>> *
>> * In fact, Einstein claimed never to memorize anything which could be
>> looked up in less than two minutes.
>> * (Quoted from: http://oaks.nvg.org/sa5ra17.html)
>> /***************************************
>>
>>
>>
>> On Thu, Dec 18, 2008 at 4:09 PM, Davy Strube <
>> [email protected]> wrote:
>>
>>> In a ColumnChart, is it possible to have columns of varying widths within
>>> the same Flex app.
>>> Let's say I have a ColumnChart with two columns, A and B.
>>> Can I have A be twice as wide as B? If so, how?
>>>
>>> --
>>> Davy Strube
>>> Synapse Analytics
>>> 1000 Abernathy Rd, Ste. 1010
>>> Atlanta, GA 30328
>>>
>>> 770-401-1542 (c)
>>> 678-389-4739 (o)
>>>
>>> -------------------------------------------------------------
>>> To unsubscribe from this list, simply email the list with unsubscribe in
>>> the subject line
>>>
>>> For more info, see http://www.affug.com
>>> Archive @ http://www.mail-archive.com/discussion%40affug.com/
>>> List hosted by FusionLink <http://www.fusionlink.com>
>>> -------------------------------------------------------------
>>
>>
>>
>> -------------------------------------------------------------
>> To unsubscribe from this list, simply email the list with unsubscribe in
>> the subject line
>>
>> For more info, see http://www.affug.com
>> Archive @ http://www.mail-archive.com/discussion%40affug.com/
>> List hosted by FusionLink <http://www.fusionlink.com>
>> -------------------------------------------------------------
>>
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>



-- 
Davy Strube
Synapse Analytics
1000 Abernathy Rd, Ste. 1010
Atlanta, GA 30328

770-401-1542 (c)
678-389-4739 (o)



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to