stacked Bar chart/Line chart hybrid- Charting

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default stacked Bar chart/Line chart hybrid- Charting

    Hi all,

    I have a requirement to have a stacked bar graph, with a line graph on the
    same chart. Has anyone here done this before? Apparently there is a known
    problem with combining line graphs with stacked charts. The following error
    gets displayed.

    ReferenceError: Error #1056: Cannot create property offset on
    mx.charts.series.LineSeries.
    at
    mx.charts::ColumnChart/applySeriesSet()[C:\Work\flex\dmv_automation\projects\dat
    avisualisation\src\mx\charts\ColumnChart.as:467]
    at
    mx.charts.chartClasses::CartesianChart/http://www.adobe.com/2006/flex/mx/interna
    l::updateSeries()[C:\Work\flex\dmv_automation\projects\datavisualisa tion\src\mx\
    charts\chartClasses\CartesianChart.as:1454]
    at
    mx.charts.chartClasses::ChartBase/commitProperties()[C:\Work\flex\dmv_automation
    \projects\datavisualisation\src\mx\charts\chartCla sses\ChartBase.as:1755]
    at
    mx.charts.chartClasses::CartesianChart/commitProperties()[C:\Work\flex\dmv_autom
    ation\projects\datavisualisation\src\mx\charts\cha rtClasses\CartesianChart.as:11
    49]
    at
    mx.core::UIComponent/validateProperties()[E:\dev\3.0.x\frameworks\projects\frame
    work\src\mx\core\UIComponent.as:5670]
    at
    mx.managers::LayoutManager/validateProperties()[E:\dev\3.0.x\frameworks\projects
    \framework\src\mx\managers\LayoutManager.as:519]
    at
    mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\proje
    cts\framework\src\mx\managers\LayoutManager.as:639]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at
    mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\fra
    mework\src\mx\core\UIComponent.as:8460]
    at
    mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\fram
    ework\src\mx\core\UIComponent.as:8403]

    Any insight would be greatly appreciated.



    Bayani Portier Guest

  2. Similar Questions and Discussions

    1. Charting with stacked hybrid plot - how do I?
      Is there a way to stack column and line charts? I want the same CartesianChart to have bars with multiple series, and centered above them, I...
    2. Charting using ActionScript and chart height,width andaxis labels
      hello, i am creating charts using action script but can't seem to do 2 things right now. 1. put labels on the axisis. 2. i can't set the...
    3. Refreshing chart data doesnt update chart
      I must be missing something simple here. I have a column chart that is using an array for its dataprovider. However, when I update the underlying...
    4. chart problem: set type="stacked"
      I wrote a cfc to return an array to flex. the content is : <cfset obj=StructNew()> <cfset obj = "1"> <cfset obj = "500"> <cfset obj = "400">...
    5. DRKv5 3D Line Chart line width, rendering problems
      I am using the DevNet Resource Kit Version 5 3D Charting components. The line chart component has a minimum line width parameter, but the minimum...
  3. #2

    Default Re: stacked Bar chart/Line chart hybrid- Charting

    Hi Bayani, the trick is to use a CartesianChart instead of a ColumnChart.
    Here's an example taken from the
    [url]http://livedocs.adobe.com/flex/3/html/charts_displayingdata_11.html#330480[/url]
    documentation. --Bruce



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

    [Bindable]
    public var expenses:ArrayCollection = new ArrayCollection([
    {Month:"Jan", Profit:2000, Expenses:1500, Amount:450},
    {Month:"Feb", Profit:1000, Expenses:200, Amount:600},
    {Month:"Mar", Profit:1500, Expenses:500, Amount:300},
    ])
    ]]>
    </mx:Script>

    <mx:Panel title="Stacked Column-Line Chart">
    <mx:CartesianChart dataProvider="{expenses}" showDataTips="true">
    <mx:horizontalAxis>
    <mx:CategoryAxis dataProvider="{expenses}" categoryField="Month"/>
    </mx:horizontalAxis>

    <mx:series>
    <mx:ColumnSeries yField="Profit" displayName="Profit"/>
    <mx:ColumnSeries yField="Expenses" displayName="Expenses"/>
    <mx:LineSeries yField="Amount" displayName="Amount"/>
    </mx:series>
    </mx:CartesianChart>
    </mx:Panel>
    </mx:Application>

    sasbrw Guest

  4. #3

    Default Re: stacked Bar chart/Line chart hybrid- Charting

    Bayani,
    Could you post some of your code?

    Thanks,

    Davo

    davidmedifit Guest

  5. #4

    Default Re: stacked Bar chart/Line chart hybrid- Charting

    Bayani,
    Could you post some of your code?

    Thanks,

    Davo

    davidmedifit Guest

  6. #5

    Default Changes while combining Columnchart and line chart

    Hi Bayani,
    When i have only Column series then the bars in the stacked column chart are very closer to each other.But when i add a line series to the same, then the gap between each bar in the column chart is increased. whats the reason for that...? How can i resolve that problem..?
    Ram Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139