Professional Web Applications Themes

stacked Bar chart/Line chart hybrid- Charting - Macromedia Flex General Discussion

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.0.x\frameworks\projects\frame work\src\mx\core\UIComponent.as:5670] at mx.managers::LayoutManager/validateProperties()[E:\dev.0.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:519] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev.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.0.x\frameworks\projects\fra mework\src\mx\core\UIComponent.as:8460] at mx.core::UIComponent/callLaterDispatcher()[E:\dev.0.x\frameworks\projects\fram ework\src\mx\core\UIComponent.as:8403] Any insight would be greatly appreciated....

  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. #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]
    doentation. --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

  3. #3

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

    Bayani,
    Could you post some of your code?

    Thanks,

    Davo

    davidmedifit Guest

  4. #4

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

    Bayani,
    Could you post some of your code?

    Thanks,

    Davo

    davidmedifit Guest

  5. #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

Similar Threads

  1. Charting with stacked hybrid plot - how do I?
    By jarvs384 in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 29th, 01:37 AM
  2. Charting using ActionScript and chart height,width andaxis labels
    By LittleMuscle in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 19th, 11:43 PM
  3. Refreshing chart data doesnt update chart
    By Mission2k in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 13th, 11:21 PM
  4. chart problem: set type="stacked"
    By lightrain in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: March 11th, 06:14 AM
  5. DRKv5 3D Line Chart line width, rendering problems
    By dbarker webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: January 26th, 04:48 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
  •  

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