Topic
  • 4 replies
  • Latest Post - ‏2009-08-19T21:07:06Z by jvarga
jvarga
jvarga
7 Posts

Pinned topic WebCharts - Set maximum bar thickness/width

‏2009-08-13T16:32:43Z |
Does anyone know how to set a maximum width (thickness) for bars in a WebCharts bar graph? When a graph only has a couple bars (or worse yet, just one) the bars are ridiculously huge.

See the attached image for what a graph with a single bar is coming out like. Thanks in advance!
Updated on 2009-08-19T21:07:06Z at 2009-08-19T21:07:06Z by jvarga
  • wudongf
    wudongf
    289 Posts

    Re: WebCharts - Set maximum bar thickness/width

    ‏2009-08-14T01:27:39Z  
    Hi,

    You can set the shapeSize to limit the width.

    Here is an example:

    <?xml version="1.0" encoding="UTF-8"?>
    <frameChart is3D="false">
    <frame xDepth="12" yDepth="11"/>
    <yAxis scaleMin="0">
    <labelFormat pattern="#,##0.###"/>
    <parseFormat pattern="#,##0.###"/>
    </yAxis>
    <legend allowSpan="true" equalCols="false" halign="Right" isMultiline="true">
    <decoration style="None"/>
    </legend>
    <elements shapeSize="20" lineWidth="1" drawShadow="true" fixedWidth="1">
    <morph morph="Grow"/>
    </elements>
    <table>
    <heatmap isEnabled="false" minLevel="0.0" maxLevel="0.0"/>
    </table>
    <decoration style="RoundShadow"/>
    <paint palette="Pastel" isVertical="true" min="47" max="83"/>
    <insets right="5"/>
    </frameChart>
  • jvarga
    jvarga
    7 Posts

    Re: WebCharts - Set maximum bar thickness/width

    ‏2009-08-14T16:21:04Z  
    • wudongf
    • ‏2009-08-14T01:27:39Z
    Hi,

    You can set the shapeSize to limit the width.

    Here is an example:

    <?xml version="1.0" encoding="UTF-8"?>
    <frameChart is3D="false">
    <frame xDepth="12" yDepth="11"/>
    <yAxis scaleMin="0">
    <labelFormat pattern="#,##0.###"/>
    <parseFormat pattern="#,##0.###"/>
    </yAxis>
    <legend allowSpan="true" equalCols="false" halign="Right" isMultiline="true">
    <decoration style="None"/>
    </legend>
    <elements shapeSize="20" lineWidth="1" drawShadow="true" fixedWidth="1">
    <morph morph="Grow"/>
    </elements>
    <table>
    <heatmap isEnabled="false" minLevel="0.0" maxLevel="0.0"/>
    </table>
    <decoration style="RoundShadow"/>
    <paint palette="Pastel" isVertical="true" min="47" max="83"/>
    <insets right="5"/>
    </frameChart>
    Thanks. I was aware of that setting. It doesn't do quite what I want though. That same graph may display anywhere from 1 to a couple dozen bars. The shapeSize setting sets the width of the bar as a percentage of the total space it's allowed to take up. When we have a lot of bars on the graph they end up being tiny...almost lines instead of bars. But maybe I can come up with a way to change the style based on the column (bar) count... not sure if that can be done.
  • wudongf
    wudongf
    289 Posts

    Re: WebCharts - Set maximum bar thickness/width

    ‏2009-08-17T02:26:35Z  
    • jvarga
    • ‏2009-08-14T16:21:04Z
    Thanks. I was aware of that setting. It doesn't do quite what I want though. That same graph may display anywhere from 1 to a couple dozen bars. The shapeSize setting sets the width of the bar as a percentage of the total space it's allowed to take up. When we have a lot of bars on the graph they end up being tiny...almost lines instead of bars. But maybe I can come up with a way to change the style based on the column (bar) count... not sure if that can be done.
    Yes, that's exactly what I'm going to suggest.
    You can specify indirect reference(E.g. a method) for Chart Style/Style Data input, and in that method, you can generate the style dynamically based on the bars you may have.
  • jvarga
    jvarga
    7 Posts

    Re: WebCharts - Set maximum bar thickness/width

    ‏2009-08-19T21:07:06Z  
    • wudongf
    • ‏2009-08-17T02:26:35Z
    Yes, that's exactly what I'm going to suggest.
    You can specify indirect reference(E.g. a method) for Chart Style/Style Data input, and in that method, you can generate the style dynamically based on the bars you may have.
    OK, that's what I did and it seems to be working. It's a bit kludgey, but what can you do? Thanks.