3 Replies Latest reply on Jan 17, 2010 11:11 PM by Flexi_Abhi

    Column Chart displaying blank columns

    Flexi_Abhi

      I've this column chart whose data provider is set dynamically. The chart has a two Column Series. Occasionally the columns are displayed as blank.

      Although the corresponding labels on x-axis and tool tips are displayed correctly. Has anyone experienced similar issue? Kindly suggest a solution.

        • 1. Re: Column Chart displaying blank columns
          Umal Kumar Adobe Employee

          Never faced this type of issue but this may be due to the reason that when you are setting the dataprovider dynamically the dataprovider is either not set or has null values. Can you please send me a sample code of yours so that i can look at the issue you are facing at my end.

          • 2. Re: Column Chart displaying blank columns
            Flexi_Abhi Level 1

            Thanks for the reply. No the data provider is surely not null as the same collection

            is being set as data provider for a data grid too. And data grid always displays the data.

            Besides if the data provider was null it wouldn't have shown the x-axis labels and the

            tool tip values.

             

            Code Sample:

             

            Basically chartData is a XMLListCollection object, its being populated on a call back method of a

            HTTPService request.

             

            The following method is called once the chartData is populated.

             

             

            //Populate columns for abcChart

            private function populateColumns():void {

             

             

                 abcChart.series = new Array();

             

                 var haltsSeries:ColumnSeries = new ColumnSeries();

                 var haltsFill:SolidColor = new SolidColor(0xFF0000);

                 haltsSeries.dataProvider = chartData;

                 haltsSeries.displayName = "Halts";

                 haltsSeries.yField = "HALTS";

                 haltsSeries.setStyle("fill",haltsFill);

                 abcChart.series.push(haltsSeries);

             

             

                 var warningsSeries:ColumnSeries = new ColumnSeries();

                 var warningsFill:SolidColor = new SolidColor(0xFFFF66);

                 warningsSeries.dataProvider = chartData;

                 warningsSeries.displayName = "Warnings";

                 warningsSeries.yField = "WARNINGS";

                 warningsSeries.setStyle("fill",warningsFill);

             

                 abcChart.series.push(warningsSeries);

             

                 return;

            }

             

            Following is the Columnchart with its children and properties.

             

            <mx:ColumnChart id="abcChart" showDataTips="true"

            width="100%" height="95%" visible="false"

            dataTipFunction="chartDataTip">

            <mx:backgroundElements>

            <mx:GridLines direction="horizontal">

            <mx:horizontalStroke>

            <mx:Stroke color="0xCCCCCC" weight="1"/>

            </mx:horizontalStroke>

            </mx:GridLines>

            </mx:backgroundElements>

            <mx:horizontalAxis>

            <mx:CategoryAxis displayName="Area"

            categoryField="AREA"/>

            </mx:horizontalAxis>

            <mx:horizontalAxisRenderer>

            <mx:AxisRenderer fontSize="8"

            cachePolicy="off" rotation="40"/>

            </mx:horizontalAxisRenderer>

            <mx:verticalAxis>

            <mx:LinearAxis title="Count"

            minimum="0" autoAdjust="true"/>

            </mx:verticalAxis>

            </mx:ColumnChart>

             

            • 3. Re: Column Chart displaying blank columns
              Flexi_Abhi Level 1

              I guess there is some issue with flex itself. Anyways I went with a temporary solution by moving the columnseries within the columnchart tag itself.