5 Replies Latest reply on Aug 4, 2009 3:15 AM by nikos101

    I have a bar chart and I need to completely remove the axis labels

    nikos101 Level 2

      I have a bar chart and I need to completely remove the axis labels and only have 1px black lines on the axis.

       

      I tried this in the style but the font-size:0; doesn't make the labels completely disappear.

       

      BarChart {
              horizontalAxisStyleName:myAxisStyles;
              verticalAxisStyleName:myAxisStyles;
           }

       

           .myAxisStyles {
              tickPlacement:none;
              font-size:0;
           }

        • 1. Re: I have a bar chart and I need to completely remove the axis labels
          djgrrr

          Try adding a verticalAxisRenderer and a horizontalAxisRenderer between your barChart tags.

           

          ie.

           

          <mx:barChart>

          ....

           

          <mx:verticalAxisRenderers>

               <mx:AxisRenderer axis="theIDofYourVerticalAxis" showLabels="false"/>

          </mx:verticalAxisRenderers>

           

           

          <mx:horizontalAxisRenderers>

               <mx:AxisRenderer axis="theIDofYourHorizontalAxis" showLabels="false"/>

          </mx:horizontalAxisRenderers>

           

           

          ...

          </mx:barChart>

           

           

           

          The key is in setting the showLabels property to false.

           

           

          J

          • 3. Re: I have a bar chart and I need to completely remove the axis labels
            nikos101 Level 2

            I'm getting a weird error: for the following code

             

             

            Initializer for 'axis': values of type mx.charts.chartClasses.IAxis cannot be represented in text.  

             

             

            <mx:BarChart x="19" y="154" id="barchart1"  backgroundElements="{bge}" width="288" height="99" showDataTips="true" dataTipFunction="barDataTips">

             

                    <mx:verticalAxis >
                        <mx:CategoryAxis id="va" categoryField="type"/>
                    </mx:verticalAxis>

             

                    <mx:horizontalAxis >
                        <mx:LinearAxis   id="a1" minimum="0">

             

                        </mx:LinearAxis>
                    </mx:horizontalAxis>
                   
                   
                    

             

            <mx:verticalAxisRenderers>

             

                 <mx:AxisRenderer axis="va" showLabels="false"/>

             

            </mx:verticalAxisRenderers>

             

             

             

             

             

            <mx:horizontalAxisRenderers>

             

                 <mx:AxisRenderer axis="a1" showLabels="false"/>

             

            </mx:horizontalAxisRenderers>

             


                   
                   

             

                    <mx:series>
                       
                            <mx:BarSeries barWidthRatio=".80"  xField="amountM" yField="type">
                           <mx:fill>
                                <mx:SolidColor color="0x00a4e8"/>
                           </mx:fill>
                                    <mx:showDataEffect>
                                <mx:SeriesInterpolate duration="500"/>
                            </mx:showDataEffect>
                        </mx:BarSeries>
                       
                        <mx:BarSeries barWidthRatio=".80"  xField="amountB" yField="type">
                           <mx:fill>
                                <mx:SolidColor color="0xd1d1d1"/>
                           </mx:fill>
                                    <mx:showDataEffect>
                                <mx:SeriesInterpolate duration="300"/>
                            </mx:showDataEffect>
                        </mx:BarSeries>
                        <mx:BarSeries barWidthRatio=".80"  xField="amountH" yField="type">
                           <mx:fill>
                                <mx:SolidColor color="0xc1c1c1"/>
                           </mx:fill>
                                    <mx:showDataEffect>
                                <mx:SeriesInterpolate duration="200"/>
                            </mx:showDataEffect>
                        </mx:BarSeries>

             

                       
                    </mx:series>
                </mx:BarChart>

            • 4. Re: I have a bar chart and I need to completely remove the axis labels
              flexprad09 Level 2

              Replace this

              <mx:AxisRenderer axis="va" showLabels="false"/>

              By

              <mx:AxisRenderer axis="{va}" showLabels="false"/>

              this

               

              and similarly the other one.

               

              I hope this will help.

               

              Regards,

               

              Prad

               

              If this post answered your question or helped, please mark it as such.

              1 person found this helpful