0 Replies Latest reply on Sep 14, 2011 8:30 AM by martinjconnolly

    Problem with dynamically created columnchart (FB 4 and 4.5)

    martinjconnolly Level 1

      I have an application (written in FB4 but I've imported to FB4.5 with no difference in behaviour) which dynamically creates cartesian charts. The total column values should be the same but the user can group them according to different fields. This works fine except for one of the possible grouping options. When that is used, I can see that all the data is present in the dataprovider, but one of the groups is just not shown - or rather when you hover over the column it shows "0" as the value for that group.

      This is the code I run when the HTTP query comes back:

       

      private function gotGroupHistory():void{
         

          if (hsGroupHistory.lastResult.list.item is mx.utils.ObjectProxy) {
              histModelSource = new ArrayCollection;
              histModelSource.addItem(hsGroupHistory.lastResult.list.item);
          } else {
              histModelSource = hsGroupHistory.lastResult.list.item;
          }
          var grouparray:Array=new Array();
          var cset:ColumnSet = new ColumnSet;
          cset.type="stacked";
          var csplan:LineSeries=new LineSeries();
          csplan.displayName="Target";
          csplan.yField="plan";
          for each(var thisitem:String in chartgroups) {
              var cs:ColumnSeries=new ColumnSeries();
              cs.yField=thisitem;
              cs.displayName=thisitem;
              cset.series.push(cs);
          }
              columnchart1.series=[cset];
              columnchart1.series.push(csplan);
              columnchart1.invalidateSeriesStyles();
              columnchart1.series=columnchart1.series;
              legend1.dataProvider=columnchart1;
         
      }

       

      As I said everything appears to be correct - the data provider has the data for all the groups but just 1 of them is not displayed. The legend also shows the name of the missing group. I really cannot figure out what is going on. Can anyone suggest my next line of investigation please?

       

      Thanks

      Martin