8 Replies Latest reply: Feb 28, 2011 10:16 AM by K Cannell RSS

    Apex Chart Size

      hi all.

      i m using flash charts in apex. the problem here is that i choose chart size say 600 x 600. but this is depicted as the chart area size. Apex automatically adjust the actual pie chart within this 600 x 600 square which is some times teasingly small. is there n e way to control the actually chart size i.e the size of pie not the square with in which the pie displays?????

      urgent help is required and help would highly be appreciated.

      thanks in advance.
        • 1. Re: Apex Chart Size

          On the Chart settings, set the Chart XML option to Yes.

          In the "Custom XML" setting, find this line:
          <pie_chart rotation="-90" radius="141" captions_radius="1.1" protrusion_radius="0">
          and increase the *radius" setting.  You can also change the settings in:
          <chart_area enabled="yes" x="30" y="30" width="520" height="340" deep="0">
          x and y determine the top-left co-ordinates of the chart area within the region and height and width relate to the chart size. Ensure that you change the main Chart Width and Chart Height settings to accommodate your changes

          • 2. Re: Apex Chart Size
            Following code is placed in chart XML of mine. now where to make the changes.
            <?xml version = "1.0" encoding="utf-8" standalone = "yes"?>
                <animation enabled="true"/>
                <no_data show_waiting_animation="False">
                    <font family="Verdana" bold="yes" size="10"/>
              <margin left="0" top="" right="0" bottom="0" />
                <chart plot_type="Pie" name="chart_2610711828219957"> 
                    <title text_align="Center" position="Top" padding="-70" >
                      <text>Corps Wise Details</text>
                      <font family="Tahoma" size="14" color="0x000000" />
                      <fill type="Gradient">
                        <gradient angle="0" type="Linear" >
                          <key position="0" color="0xCCCCFF" />
                          <key position="1" color="0x00CCCC" />
                      <border enabled="false"/>
                      <corners type="Square"/>
                    <chart_animation type="Appear" interpolation_type="Quadratic" show_mode="OneByOne"/>
                  <data_plot_settings enable_3d_mode="true" >
                    <pie_series style="Aqua">
                      <tooltip_settings enabled="true">
                        <format><![CDATA[{%Name}{enabled:False} - {%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                        <font family="Tahoma" size="10" color="0x000000" />
                          <position anchor="Float" valign="Top" padding="10" /> 
                      <label_settings enabled="true" mode="Outside" multi_line_align="Center">
                        <format><![CDATA[{%Name}{enabled:False} - {%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
                        <background enabled="false"/>
                        <font family="Tahoma" size="10" color="0x" />
                      <marker_settings enabled="True" >
                        <marker type="None" />
                      <connector color="Black" opacity="0.4"/>
            Edited by: jamalkio77 on Jan 18, 2011 1:38 AM
            • 3. Re: Apex Chart Size

              What version of Apex are you using?
              • 4. Re: Apex Chart Size
                hi Andy

                i built application in 4.0 and imported in 4.0.2 recently.
                • 5. Re: Apex Chart Size
                  OK - seems those settings relate to 2D pie charts and, in fact, seem to be using an older version of AnyChart anyway.

                  I've looked through the AnyChart documentation - http://anychart.com/products/anychart/docs/xmlReference/index.html

                  According to that, the radius can be set on &lt;charts&gt;&lt;chart&gt;&lt;data_plot_settings&gt;&lt;pie_series radius="100"&gt;

                  The blurb says: Sets pie/doughnut radius in percents of min plot side

                  But, I can not find "min plot side" anywhere. And, no value entered for the radius setting makes any difference - the pie chart is always the same size.

                  It looks like, as with Apex 3, the AnyChart implementation in Apex bears only a passing resemblance to AnyChart's website documentation - tag names are different and attributes don't work.

                  Other than switching to a 2D chart, I'm not sure what to suggest. Unless someone else has found an undocumented tag/attribute - or Apex release the documentation they use.

                  • 6. Re: Apex Chart Size
                    K Cannell
                    I have the same issue with 3D Pie charts.

                    Two problems, actually:
                    1. Upon upgrading, the pie charts come in very tiny.
                    Manually recreating the pie charts results in larger charts, but the size is not predicatble (that I can see).

                    2. Because the size is not predictable, I am not able to get pie charts of a consistent diameter on the same page.
                    The result is sloppy - looks like someone forgot to set a size or radius parameter.

                    I tried applying the "radius" entry in the XML , no difference.
                    I was not able to get a clean chart_area entry in the XML., as suggested above.
                    Using 2D Pie does not afford any way to adjust settings either ...

                    Are there any options here?
                    As is, I cannot use this chart type if I cannot somehow match the pie diameters.

                    thank you -
                    • 7. Re: Apex Chart Size
                      Hello Andy and jamalkio77 -

                      Andy is correct, with the line
                      <charts><chart><data_plot_settings><pie_series radius="100">
                      This will adjust the size of the pie chart, but we need to understand a bit of geometry to use it.

                      First off, we are setting the radius of the circle. And according to the documentation
                      Sets pie/doughnut radius in percents of min plot side
                      So, we are setting how long the radius of the pie is in relation to the width of the container. So, a value of 50 means that the radius of the circle will take up 50% of the width of the container. That also means that the diameter of the pie will take up 100% of the width of the container (diameter = radius * 2). Therefore, the maximum value for the radius attribute is 50. Anything above 50 is treated as 50. You can set the value to 5, or 10, or 12 and the pie will shrink accordingly. To make the pie the maximum size, you want this value to be 50.

                      Next, understand that we are working with containers. So, the Anychart is a container, and within that you have the Chart container, and within that you have the Data Plot container. Lastly, you have the Pie container. All of these containers take up a little bit of space. You can hide them though with the enabled="false" attribute. This may help recover some real estate. Since we are working with a 3D pie chart, we may be running into an issue with the depth of the pie slices are dictating the height of the chart. It may be that if the depth of the pie is decreased, then you may get more room and slightly bigger pie's. I have not tested this behavior though. Another idea you could research is that of tilting the pie along the Z axis more. I do not know if this is possible but it may be a topic for investigation.

                      The other option here is to simply use a 2D pie chart. That may very well be the best way to maximize the size of the pie, if you must use a pie chart. On a personal note, I believe that there is almost always a better way to display the data other than a pie chart. This however is a personal bias against pie charts.

                      • 8. Re: Apex Chart Size
                        K Cannell
                        Found it - thank you for the suggestions.

                        When I turned the labels off - <label_settings enabled="false" mode="Outside" multi_line_align="Center">
                        the radius value I was entering kicks in.

                        Apparently AnyChart adjusts the size of the graphic to fit everything in, labels, legend, etc in the chart area. My long labels were causing a smaller chart. I'll try shorter labels, and/or, opt for legend instead of labels, or some combination that gives me the consistent chart size that I need.

                        Good stuff ... Thank you, Karen