Bar Chart Bar Width

I am strugllig hard to have all my bars have a same width. Followig is what the code looks like:
<?xml version="1.0"?>
<!-- charts/UsingBarSets.mxml -->
<s:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark"
    >
    <s:layout>
        <s:VerticalLayout/>
    </s:layout>
    <fx:Script><![CDATA[
        import mx.charts.Legend;
        import mx.charts.BarChart;
        import mx.charts.series.BarSet;
        import mx.charts.series.BarSeries;
        import mx.collections.ArrayCollection;
        [Bindable]
        private var yearlyData:ArrayCollection = new ArrayCollection([
            {month:"January", label:"January", planned:5000, funded:5000,
                spent:4000},
            {month:"February", label:"February", planned:7000, funded:6000,
                spent:7000},
            {month:"March", label:"March", planned:8000, funded:7000,
                spent:6000},
            {month:"April", label:"April",planned:10000, funded:1000,
                spent:12000}
        [Bindable]
        private var yearlyData1:ArrayCollection = new ArrayCollection([
            {month:"January", revenue:120, costs:45,
                overhead:102, oneTime:23},
            {month:"February", revenue:108, costs:42,
                overhead:87, oneTime:47},
            {month:"March", revenue:150, costs:82,
                overhead:32, oneTime:21},
            {month:"April", revenue:170, costs:44,
                overhead:68},
            {month:"May", revenue:250, costs:57,
                overhead:77, oneTime:17},
            {month:"June", revenue:200, costs:33,
                overhead:51, oneTime:30},
            {month:"July", revenue:145, costs:80,
                overhead:62, oneTime:18},
            {month:"August", revenue:166, costs:87,
                overhead:48},
            {month:"September", revenue:103, costs:56,
                overhead:42},
            {month:"October", revenue:140, costs:91,
                overhead:45, oneTime:60},
            {month:"November", revenue:100, costs:42,
                overhead:33, oneTime:67},
            {month:"December", revenue:182, costs:56,
                overhead:25, oneTime:48},
            {month:"May", revenue:120, costs:57,
                overhead:30}
    ]]></fx:Script>
        <mx:BarChart id="myChart"
                     dataProvider="{yearlyData}" showDataTips="true"  width="100%" height="100%" >
            <mx:verticalAxis>
                <mx:CategoryAxis categoryField="month"/>
            </mx:verticalAxis>
            <mx:series>
                <mx:BarSet type="clustered" >
                    <mx:BarSeries xField="planned"
                                  displayName="Planned" />
                    <mx:BarSet type="overlaid">
                        <mx:BarSeries
                            xField="funded"
                               displayName="Funded"/>
                        <mx:BarSeries
                            xField="spent"
                            displayName="Spent"/>
                    </mx:BarSet>
                </mx:BarSet>
            </mx:series>
        </mx:BarChart>
</s:Application>

Take a look at the Bar Chart's barWidthRatio and maxBarWidth styles. They interact with one another,so are a little unpredictable.
One tactic I use in the case where the bar widths are critical to the design is to set up two horizontal slider and bind the barWidthRatio and maxBarWidth properties to them. Now you can adjust them at run time and watch how they interact, and pick up the most appropriate values to use. Makes it much easier.

Similar Messages

  • Bar Chart: Bar Z-Index

    I am trying to create a vertical bar chart. However, I have run into a small snag.
    My chart:
    - The X-axis has the next 12 months.
    - Y-axis has calculated values.
    I have multiple calculated values(bars) for each month(Column). Because of this I need to overlap the bars and show them in order of tallest down-to the shortest.
    The problem:
    When I overlap the bars it doesn't show all of the bars. The graph draws the bars in order of the timeline. The bar that is earliest in the timeline gets drawn first. Because of this, the shorter bars at the beginning of the timeline get hidden by the taller bars near the end of the timeline.
    Is there a way I can sort these bars to show smallest - largest per month in their correct series color?
    More Info:
      A bar represents a project that can span multiple months.
    Dataset:
    Project Name, Month, hours
    Proj1, Jan, 5
    Proj1, Feb, 6
    Proj1, Mar, 6 <-- will be hidden by Proj2, Mar, 7
    Proj1, Apr, 5 <-- will be hidden by Proj2, Apr, 8
    Proj2, Mar, 7
    Proj2, Apr, 8
    Proj2, May, 7
    I hope this edit makes it a bit more clear.
    Thanks for the assistance!
    Edited by: Joseph Forsythe on Sep 30, 2008 8:18 PM

    Hello -
    I use Custom XML to accomplish this. You want to define the format of the <label_settings> tag. Below is sample code fron one of my bar charts. I've separated the <format> tag so you can see it easily. Notice the numDecimals:2 that is what defines how many decimals to show.
         <data_plot_settings enable_3d_mode="false" >
            <bar_series style="Default">
              <tooltip_settings enabled="true">
                <format><![CDATA[{%Name}{enabled:False} - {%Value}{numDecimals:2,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                <font family="Tahoma" size="10" color="0x000000" />
                  <position anchor="Float" valign="Top" padding="10" />
              </tooltip_settings>
              <label_settings enabled="true" mode="Outside" multi_line_align="Center">
                <format><![CDATA[{%Value}{numDecimals:2,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                <background enabled="false"/>
                <font family="Arial" size="10" color="0x000000" />
              </label_settings>
              <bar_style>
              </bar_style>
              <marker_settings enabled="True" >
                <marker type="None" />
              </marker_settings>
            </bar_series>
          </data_plot_settings>
    ...You may be able to do this without Custom XML. There is a decimal places field in the Axis Settings section of the chart attributes, but i'm pretty sure that only affects the axis display settings.
    Austin

  • CR for VS 2005 - Bar Chart - Bar colors

    Hi,
    I'm creating a report in Visual Studio 2005 and have a bar chart in it.  I've searched the forums but can't seem to find out how to change the colors of the Series bars.
    If anybody has any ideas or suggestions, they would be greatly appreciated.
    Thanks in advance.
    Ron

    Apparently, the version of CR that ships with Visual Studio doesn't allow much in the way of customization.  I have since upgraded to CR 2008 and can now change the bar colors.

  • Stacked bar chart - layout

    Hi,
    is there any way to control the layout of a stacked bar chart (bar width and (horizontally) distance between bars)?
    In my chart all bars are on the left side while there is much free space on the right side. So is there a possibility to dynamically scale the bars?

    Hi Denes,
    thanks for your advice. I've alreadey looked at your charting tool a few days ago and it really looks fine. I think I am going to try it out for future projects. But this project is nearly finished and I don't want to change that much at the moment.

  • BEX map does not represent data, neither as hue nor as circle or bar chart.

    Hello together, I hope myself can someone help.
    Under the Web Application designer (WAD), release 2004s, support Package 12, Patch 1, revision 314, I get the pure map of the world in the report only indicated.
    If I select care in the Web Item of the Item "map" as renderer value bar chart [BAR], then I get only one legend indicated and otherwise nothing.
    Same applies also with the pie chart. A test, where I all countries with those data available are not in a sharp blue indicate let, I get in the Web report the map of the world indicated where all countries blue colored am.
    With the counter proof with the WAD finally release 3,5 functions it with to same DATA perfectly the Provider. Also the bar charts are indicated.
    The associated of characteristic info object is duly maintained as info object with static geo characteristic. The shapefile DBF is maintained and into the BDS high-loaded also with the appropriate, adapted SAPBWKEY (which proves a functioning in the 3.5er WAD).
    Super would if be someone a solution would have.

    As this is a configuration issue and not a programming issue I' moving your question to a more appropriate forum where you're more likely to find assistance.
    Cindy Meister, VSTO/Word MVP,
    my blog

  • *Is there any way to limit the Chart Bar size dynamically?*

    Hi
    I have selected the Marker size as Medium for my Bar chart.
    Bar chart bar showing too big when there is only one bar.
    Is there any way to limit the bar size dynamically?
    Thank you

    hi Ruwan,
    Don is correct in that there is no option in the chart design component to do this.
    what you can do though (i know it is a pain) is to
    1) create a new chart in a new section with a narrower bar using the chart options dialogue
    2) create a conditional suppression formula for the new section and the old chart section based on the value returned in the Show Value for the chart
    i have created a request for a charting overhaul [here |https://ideas.sap.com/community/products_and_solutions/crystalreports;jsessionid=B3E2E9F6A6CC9C9F5321659382A91855.node0]in the ideas place which includes a solution for this particular issue. please feel free to give it the thumbs up if you think that this is a worthwhile idea.
    jamie

  • How to change the width of the bar of bar charts?

    Hi,
    I am using Crystal Reports 11.
    I created some stacked bar charts. Now, I want to change the width of the bar. Some one told me that I can't do that because it's totally controlled internally by Crystal Reports.
    Really?
    If could, how could I do?
    Thank you in advance.

    Hi,
    The only way you can set the width of the bar is by going to Chart Options (Right-click Chart in Preview Mode > Chart Options > Appearance tab > Decrease the Gap Width).
    Hope this helps!
    -Abhilash

  • Flash Chart Bar Width

    Is there a way to limit the width of the bars on a flash bar chart?
    I've found that if I have but one bar on the chart it fills the entire chart area.
    Doesn't look so good.
    Bob

    Hello,
    I did a blog post about that: http://dgielis.blogspot.com/2008/06/specify-same-width-of-column-chart-in.html
    The only way I can think of doing it, is to calculate the number of bars and adjust some parameters depending that. You do that by using Custom XML. I already tried it to get dynamic scaling and that worked. But I didn't have the time yet to do the bar width example, but the principle should be the same.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://www.apex-evangelists.com/
    -- http://www.apexblogs.info/

  • To increase the width of Bar in OLE excel bar chart

    Hi All,
    I am using the OLE method to bring the data of my internal table onto an excel sheet in the Vertical Bar graph.
    The data is populated correctly but the width of the bars is very less due to which I am unable to differentiate between different colours.
    How can i increase the width of the bars?
    Here is a piece of my code.
    GET PROPERTY OF gf_application 'Charts' = gf_charts .
      CALL METHOD OF gf_charts 'Add' = gf_chart .
      CALL METHOD OF gf_chart 'Activate' .
      SET PROPERTY OF gf_chart 'ChartType' = '52' . "Vertical bar graph
      CALL METHOD OF gf_chart 'SetSourceData'
      EXPORTING #1 = gf_cells
      #2 = 1.
    Please Help!

    Hi,
    I am trying to increase the width of bars in bar graph developed in 10g reports. I found your thread which says please find in my previous posting.
    I could not find. can you please enlighten me on this question
    You help will be truly appreciated.
    Thank you,

  • How to fix the width of each bar in the Bar chart.

    Hi,
    In BO design studio 1.3 is there any way to make each bar in the bar chart with fixed width.
    Thank You,
    Palani.

    Hi,
    if you are using a grid layout the witdht of the bars is not really fixed.
    When you adjust the screen size, the charts and the bars in each chart rezise according to the size of your screen.
    But that is one of the advantages using grids.
    Otherwise the size of the chart and the bars is fixed but as far as I know there is no option to manually adjust the size/width of each bar.
    Regards,
    Steffen

  • How to get the Grid lines in the background of bar chart

    How to get the background of bar chart given in the following link
    http://javafx.com/docs/articles/controls/barChart.jpg
    thanks in advance

    Set the border attribute of the table tag to zero.  Use CSS to assign your borders like this -
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style type="text/css">
    table {
              border-collapse:collapse;
              border:1px solid black;
    tr {
              border:1px solid black;
    tr.top {
              border-bottom:none;
    tr.bottom {
              border-top:none;
    </style>
    </head>
    <body>
    <table width="600" border="0">
      <tr class="top">
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr class="bottom">
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
    </table>
    </body>
    </html>

  • Stacked 100% bar chart - Problem with datatips for zero value data points

    I have a stacked 100% bar chart that shows datatips in Flex 4.   However, I don't want it to show datatips for
    data points with zero values.   Flex 4 shows the datatip for a zero value data point on the left side of a bar if the data point is not the first in the series.
    Here's the code that illustrates this problem.    Of particular concern is the July bar.    Because of the zero value data point problem, it's not possible to see the datatip for "aaa".
    Any ideas on how we can hide/remove the datatips for zero value data points ?        Thanks.
    <?xml version="1.0"?>
    <s:Application
    xmlns:fx="
    http://ns.adobe.com/mxml/2009"xmlns:mx="
    library://ns.adobe.com/flex/mx"xmlns:s="
    library://ns.adobe.com/flex/spark"creationComplete="initApp()"
    height="
    1050" width="600">
    <s:layout>
    <s:VerticalLayout/>
    </s:layout>
    <fx:Script><![CDATA[ 
    import mx.collections.ArrayCollection;[
    Bindable] 
    private var yearlyData:ArrayCollection = new ArrayCollection([{month:
    "Aug", a:1, b:10, c:1, d:10, e:0},{month:
    "July", a:1, b:10, c:10, d:10, e:0},{month:
    "June", a:10, b:10, c:10, d:10, e:0},{month:
    "May", a:10, b:10, c:10, d:0, e:10},{month:
    "April", a:10, b:10, c:0, d:10, e:10},{month:
    "March", a:10, b:0, c:10, d:10, e:10},{month:
    "February", a:0, b:10, c:10, d:10, e:10},{month:
    "January", a:10, b:10, c:10, d:10, e:10}]);
    private function initApp():void {}
    ]]>
    </fx:Script>
    <s:Panel title="Stacked Bar Chart - Problems with DataTips for Zero Value Items" id="panel1">
    <s:layout>
    <s:HorizontalLayout/>
    </s:layout>
    <mx:BarChart id="myChart" type="stacked"dataProvider="
    {yearlyData}" showDataTips="true">
    <mx:verticalAxis>
     <mx:CategoryAxis categoryField="month"/>
     </mx:verticalAxis>
     <mx:series>
     <mx:BarSeries
    xField="a"displayName="
    aaa"/>
     <mx:BarSeries
    xField="b"displayName="
    bbb"/>
     <mx:BarSeries
    xField="c"displayName="
    ccc"/>
     <mx:BarSeries
    xField="d"displayName="
    ddd"/>
     <mx:BarSeries
    xField="e"displayName="
    eee"/>
     </mx:series>
     </mx:BarChart>
     <mx:Legend dataProvider="{myChart}"/>
     </s:Panel>
     <s:RichText width="700">
     <s:br></s:br>
     <s:p fontWeight="bold">The problem:</s:p>
     <s:p>Datatips for zero value data points appear on left side of bar (if data point is not the first point in series).</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">For example:</s:p>
     <s:p>1) For "June", eee = 0, mouse over the left side of the bar to see a datatip for "eee". Not good.</s:p>
     <s:br></s:br>
     <s:p>2) For "July", eee = 0 and aaa = 1, can't see the datatip for "aaa", instead "eee" shows. Real bad.</s:p>
     <s:br></s:br>
     <s:p>3) For "Feb", aaa = 0, datatip for "aaa" (first point) does not show. This is good.</s:p>
     <s:br></s:br>
     <s:p>4) For "Mar", bbb = 0, datatip for "bbb" shows on the left side of the bar. Not good.</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">Challenge:</s:p>
     <s:p>How can we hide/remove datatips for zero value data points?</s:p>
     <s:br></s:br>
     </s:RichText></s:Application>

    FYI.
    Still have the issue after upgrading to the latest Flex Builder 4.0.1 with SDK 4.1.0 build 16076.   
    Posted this as a bug in the Adobe Flex Bug and Issue Management system.     JIRA
    http://bugs.adobe.com/jira/browse/FLEXDMV-2478
    Which is a clone of a similar issue with Flex 3 ...
    http://bugs.adobe.com/jira/browse/FLEXDMV-1984

  • Stacked Bar Chart Error

    I have a 30+ series bar chart and the dates along the bottom are not showing in order...a sample of one of the series is as follows:
    select null link, trunc(SAMPLE_TIME) label, SUM(EVENT_TIME) "CGS wait for IPC msg"
    from "DART"."DART_TOP5_TIMED"
    where event_name = 'CGS wait for IPC msg'
    and instance_name = nvl (:P1_instance_name, instance_name) and sample_time>sysdate-30
    group by trunc(SAMPLE_TIME)
    order by trunc(SAMPLE_TIME)
    Is there another line I need to add to ensure it goes in order?
    Edited by: jclarke2 on Jun 23, 2009 11:01 AM

    <?xml version = "1.0" encoding="utf-8" standalone = "yes"?>
    <root>
    <type>
    <chart type="Stacked 2DColumn">
    <animation enabled="no"/>
    <hints auto_size="yes">
    <text><![CDATA[{NAME}, {VALUE}]]></text>
    <font type="Verdana" size="10" color="0x000000" />
    </hints>
    <names show="no"/>
    <values show="no" prefix="" postfix="" decimal_separator="." decimal_places="0" />
    <arguments show="no" />
    <column_chart column_space="3" block_space="3">
    <border enabled="no" />
    <block_names enabled="yes" placement="chart" rotation="90" x_offset="0" position="bottom" >
    <font type="verdana_embed_tf" size="8" color="0x000000" />
    </block_names>
    <background type="gradient">
    <alphas>
    <alpha>100</alpha>
    <alpha>100</alpha>
    <alpha>100</alpha>
    </alphas>
    <ratios>
    <ratio>0</ratio>
    <ratio>120</ratio>
    <ratio>0xFF</ratio>
    </ratios>
    </background>
    </column_chart>
    </chart>
    <workspace>
    <background enabled="yes" type="solid" color="0xffffff" alpha="0" />
    <base_area enabled="no" />
    <chart_area enabled="yes" x="230" y="40" width="570" height="550" deep="0">
    <background enabled="no"/>
    <border enabled="no" size="1"/>
    </chart_area>
    <grid>
    <values />
    </grid>
    </workspace>
    <legend enabled="yes" x="10" y="50">
    <names enabled="yes">
    <font type="Verdana" size="10" color="0x000000" />
    </names>
    <border enabled="no"/>
    <values enabled="no"/>
    <scroller enabled="no"/>
    <header enabled="no"/>
    <background alpha="0"/>
    </legend>
    </type>
    #DATA#
    </root>

  • Help with stacked bar chart

    Hello,
    I'm looking for help regarding horizontal stacked bar chart. Typically for stacked bars Publisher seems to want data for each stacks per row, but my data looks like this:
    <DATA>
    <ROW>
    <TYPE>Type 1</TYPE>
    <CLASS>A</CLASS>
    <TOTAL>10</TOTAL>
    </ROW>
    <ROW>
    <TYPE>Type 2</TYPE>
    <CLASS>B</CLASS>
    <TOTAL>10</TOTAL>
    </ROW>
    <ROW>
    <TYPE>Type 1</TYPE>
    <CLASS>B</CLASS>
    <TOTAL>20</TOTAL>
    </ROW>
    <ROW>
    <TYPE>Type 2</TYPE>
    <CLASS>A</CLASS>
    <TOTAL>10</TOTAL>
    </ROW>
    <TYPE>Type 3</TYPE>
    <CLASS>A</CLASS>
    <TOTAL>40</TOTAL>
    </ROW>
    </DATA>
    So each bar would be the TYPE element, and each stack within the bar would be the CLASS element.
    Here is a very crude drawing of what I would want the chart to look like: http://i.imgur.com/3gEdEQ5.png
    How can I achieve this? Thanks in advance.

    Jody,
    I'm sorry that I missed that you didn't want an overlay solution. You wrote it plainly, I just didn't read carefully.
    This is as close as I could come to how I now read your request:
    Here I have charted your Actual and a column of zeros that I have called the Goal Reference. The last column contains the goal values and I have used them as Positive Custom Error Bars for the Goal Reference series. I'm not thrilled with the look, but unless I know for sure that I'm on the right track, I'll leave it there for now. The width difference between the goal and the actual can be adjusted.
    Jerry

  • Stacked Bar Chart Question

    Hi, I am creating a stacked bar chart, and I am encountering 3 issues I hope you can help me with:
    1)  The chart has positive and negative values.  I have zero based centerline checked, but I do not see 0 on the Y axis.
    2)  The applet width is 900 pixels.  The chart can have a variable number of bars.  When it has a small number of bars, they fill the entire chart.  Is there a way to set the width to a fixed amount?
    3)  Is there a way to set a logical interval amount?  Currently the numbering is not intuitive.
    Thanks
    p.s.  We are using 11.5.3
    Edited by: Richard Keegan on Jun 13, 2008 5:18 PM

    Depending upon your query structure, you can force a zero based centerline by setting the Y-axis ranges dynamically.  I am not working in 11.5.3 currently, but ran into a problem with line charts in 12.0.2.  The zero centerline flag did not work, so I dynamically generated the ranges and linked them in.
    You can probably do the same with a little extra BLS coding.
    Mike

Maybe you are looking for

  • Please help - Time Capsule Set up problems

    I bought a Time Capsule almost a year ago at the same time as my iMac, but have only tried to set it up in the last 3 weeks (so its the 6"x6"x1" version).  I followed the set up instructions numerous times but kept getting an error message in Airport

  • An error occured while getting a portlet instance

    Hello all I am trying to deploy and test accessing tn3270 portlet found here http://www.oracle.com/technology/products/ias/portal/point/tn3270/installation.html using Jdev 10.1.3.3 with preconfigured OC4J deployed the portlet to preconfigured OC4J an

  • XSLT Meterial

    Hi SDN Guru's I need to learn XSLT progarmming. Please give me some meterials or links to get start study XSLT (mapping). Thank very much your help in advance. Thanks Balaprasad

  • AI graphic placed in ID CS4 doc changes when exported to PDF

    Hi, I'm attempting to export a 6-page ID CS4 document to PDF, and am having inconsistencies in how the graphics look once they're exported. I am linking to the exact same Illustrator file when placing the logo on each page, but when I export to PDF,

  • Problem passing quoted parameter to MySql from Visual Web Pack

    In my session bean VWP did generate: private CachedRowSetXImpl myRowSet = new CachedRowSetXImpl(); The query for myRowSet is: SELECT * FROM myTable WHERE name IN ( ? ) The parameter was passed in different ways ( getSessionBean1().getMyRowSet().setSt