11 Replies Latest reply on Apr 12, 2010 12:36 AM by Magick9393

    seriously ? cant set width of chart bars?

    Magick9393 Level 1

      I posted a question a while back, trying to find a way to set the width of chart bars - and the only answer I got back said basically its not possible.

       

      http://forums.adobe.com/thread/463129?tstart=0

       

      I find this hard to believe.

       

      I still have the same problem - and my client is not happy about it, and neither am I.

       

       

      Here is my chart - note the amount of space preceeding, and between the bars, and how thin the bars are.

      I dont want this. I want the bars to be thicker.

      CropperCapture[5].jpg

       

      Here is the code I am using to create this chart. As you can see I have tried all sorts of settings in all sorts of places - padding, width, offset,
      barWidthRatio - none of them make any difference.

       

      Does anyone know how I can set the thickness/width of the bars?

           <mx:VBox x="68"
                      y="10"
                      height="100%"
                      width="100%">
                <!-- <mx:Label x="10"
                      y="10"
                      width="100%"
                      id="myChartLabel"
                      text="{myChartLabelText}"
                      textAlign="center"
                      fontWeight="bold"/> -->
      
      
                <mx:Legend dataProvider="{myChart}"
                             direction="horizontal"
                             width="400"/>
      
      
      
                <mx:BarChart id="myChart"
                                paddingBottom="0"
                                paddingLeft="0"
                                paddingRight="0"
                                paddingTop="0"
                                dataProvider="{dp}"
                                showDataTips="true"
                                seriesFilters="[]"
                                width="100%"
                                height="100%"
                                x="10"
                                y="37"
                                styleName="WasteTransferBarChart"
                                dataTipFunction="myDataTipFunction"
                                dataTipMode="single">
                     <mx:backgroundElements>
                          <mx:GridLines direction="vertical"
                                           styleName="WastesTransferBarChartGridLines"
                                           horizontalShowOrigin="false"
                                           verticalShowOrigin="false">
      
                          </mx:GridLines>
                          <mx:GridLines direction="horizontal"
                                           styleName="WastesTransferBarChartGridLines"
                                           verticalShowOrigin="false"
                                           horizontalShowOrigin="false">
                               <mx:horizontalStroke>
                                    <mx:Stroke weight="2"
                                                 color="#D5DCDC"/>
                               </mx:horizontalStroke>
      
      
                          </mx:GridLines>
                     </mx:backgroundElements>
                     <mx:verticalAxisRenderer>
                          <mx:AxisRenderer labelRenderer="InnerlabelRenderer"/>
                     </mx:verticalAxisRenderer>
                     <mx:verticalAxis>
                          <mx:CategoryAxis categoryField="Area"/>
      
                     </mx:verticalAxis>
                     <mx:horizontalAxis>
                          <mx:LinearAxis minimum="0"
                                            padding="0"
                                            maximum="{myMaximum}"
                                            interval="10"
                                            labelFunction="linearAxis_labelFunc"/>
      
      
      
      
                     </mx:horizontalAxis>
      
                     <mx:horizontalAxisRenderer>
                          <mx:AxisRenderer canDropLabels="true"
                                               placement="top">
      
                          </mx:AxisRenderer>
                     </mx:horizontalAxisRenderer>
      
      
                     <mx:series>
                          <mx:BarSet type="clustered"
                                       offset="0.714"
                                       barWidthRatio="0.714">
      
                               <mx:BarSet type="overlaid"
                                            offset="0.5"
                                            id="Total"
                                            barWidthRatio="0.714">
                                    <mx:BarSeries xField="TotalPercentage"
                                                     labelField="TotalPercentage"
                                                     displayName="{TotalPercentage}"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
                                    <mx:BarSeries xField="TotalAnnexIPercentage"
                                                     displayName="{TotalAnnexIPercentage}"
                                                     labelField="TotalAnnexIPercentage"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
      
                               </mx:BarSet>
      
                               <mx:BarSet type="overlaid"
                                            id="Disposal">
                                    <mx:BarSeries xField="DisposalPercentage"
                                                     labelField="DisposalPercentage"
                                                     displayName="{DisposalPercentage}"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
                                    <mx:BarSeries xField="DisposalAnnexIPercentage"
                                                     labelField="DisposalAnnexIPercentage"
                                                     displayName="{DisposalAnnexIPercentage}"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
      
                               </mx:BarSet>
      
                               <mx:BarSet type="overlaid"
                                            id="Recovery">
                                    <mx:BarSeries xField="RecoveryPercentage"
                                                     labelField="RecoveryPercentage"
                                                     displayName="{RecoveryPercentage}"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
                                    <mx:BarSeries xField="RecoveryAnnexIPercentage"
                                                     labelField="RecoveryAnnexIPercentage"
                                                     displayName="{RecoveryAnnexIPercentage}"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
      
                               </mx:BarSet>
      
                               <mx:BarSet type="overlaid"
                                            id="Unspecified">
                                    <mx:BarSeries xField="UnspecifiedAnnexIPercentage"
                                                     labelField="UnspecifiedAnnexIPercentage"
                                                     displayName="{UnspecifiedAnnexIPercentage}"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
                                    <mx:BarSeries xField="UnspecifiedPercentage"
                                                     labelField="UnspecifiedPercentage"
                                                     displayName="{UnspecifiedPercentage}"
                                                     barWidthRatio="0.714"
                                                     offset="-0.143"/>
                               </mx:BarSet>
                          </mx:BarSet>
                     </mx:series>
                </mx:BarChart>
      
      
           </mx:VBox>
      

       

       

      And here is the CSS that I am using -I have tweaked all sorts of various settings here, but I have not found a setting to fix the width problem.

       

      .WastesTransferBarChartGridLines{
                direction:horizontal;
              horizontalShowOrigin:false;
              horizontalTickAligned:true;
              horizontalChangeCount:1; 
              verticalShowOrigin:false;
              verticalTickAligned:true; 
              verticalChangeCount:1;
           maxBarWidth: 200;
           bottom: 0;
           top: 0;
           right: 0;
           left: 0;
                /*focusThickness: 1;
                horizontalStroke: 2;
                horizontalFill: #000000;
              horizontalFill:#990033;
              horizontalAlternateFill:#00CCFF; */
      }
      
      .WasteTransferBarChart
      {
      horizontalAxisStyleName:myAxisStyles;
      verticalAxisStyleName:myAxisStyles;
      chartSeriesStyles: PCCSeries1, PCCSeries2, PCCSeries3, PCCSeries4, PCCSeries5, PCCSeries6, PCCSeries7, PCCSeries8, air, soil, water ;
      gridLinesStyleName: WastesTransferBarChartGridLines;
           paddingBottom: 0;
           paddingLeft: 0;
           paddingRight: 0;
           paddingTop: 0;
           maxBarWidth: 200;
           barWidthRatio: 1;
      }