Home » Developer & Programmer » Application Express & MOD_PLSQL » Pie chart is showing ID number with , comma (4.0)
Pie chart is showing ID number with , comma [message #551630] Thu, 19 April 2012 14:15 Go to next message
newprogrammerSQ
Messages: 48
Registered: April 2012
Member
is it possible to change the format on the pie chart?

currently an ID number eg. 14888 is showing on the pie chart as 14,888 which spoils it.. is it possible to remove the comma to show as a whole number?
Re: Pie chart is showing ID number with , comma [message #551634 is a reply to message #551630] Thu, 19 April 2012 14:58 Go to previous messageGo to next message
newprogrammerSQ
Messages: 48
Registered: April 2012
Member
same with bar charts
Re: Pie chart is showing ID number with , comma [message #551650 is a reply to message #551634] Fri, 20 April 2012 00:11 Go to previous messageGo to next message
Littlefoot
Messages: 19294
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
On Chart Attributes page, go to "Chart XML" section and change "Use Custom XML" from NO (which is default) to YES. XML will now be editable.

Find <x_axis> node and, under its <format>, modify "thousandsSeparator" from
thousandsSeparator:\,
to
thousandsSeparator:

Apply changes and run the report.

P.S. The whole <format>; maybe you'll see it better this way:
Original:
<format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>

Modify it to:
<format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:}]]></format>

[Updated on: Fri, 20 April 2012 00:13]

Report message to a moderator

Re: Pie chart is showing ID number with , comma [message #551792 is a reply to message #551650] Fri, 20 April 2012 12:42 Go to previous messageGo to next message
newprogrammerSQ
Messages: 48
Registered: April 2012
Member
that works for the bar chart but the pie chart's legend still shows commas... can this be customised too?
Re: Pie chart is showing ID number with , comma [message #551795 is a reply to message #551792] Fri, 20 April 2012 14:03 Go to previous messageGo to next message
Littlefoot
Messages: 19294
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I tried it on Apex version 4.1.1.00.23 with the following simple query:
select 
  null link,
  to_char(hiredate, 'yyyy') year,
  sum(sal) sum_sal
from emp
group by to_char(hiredate, 'yyyy')

Here's the pie chart, which is its result:

./fa/10076/0/

As you can see, there's no thousands separator here.

Please, post your query (if it is based on Scott's schema, fine. If not, provide test case as well) so that we could try it and see what happens.

P.S. Don't mix salaries (which are Y-axes values) with years (which are X-axes values)! Y-axes values can have thousands separator (at least, I don't see a reason why couldn't it).
  • Attachment: pie_chart.png
    (Size: 24.07KB, Downloaded 310 times)

[Updated on: Fri, 20 April 2012 14:05]

Report message to a moderator

Re: Pie chart is showing ID number with , comma [message #551796 is a reply to message #551795] Fri, 20 April 2012 14:07 Go to previous messageGo to next message
newprogrammerSQ
Messages: 48
Registered: April 2012
Member
It shows correct how yours does however the legend which is the key for it shows it in a different format as 1,499 but the piechart it self is labelled as it should be (1499).
Custom XML:
<?xml version = "1.0" encoding="utf-8" standalone = "yes"?>
<anychart>
  <settings>
    <animation enabled="false"/>
    <no_data show_waiting_animation="False">
      <label>
        <text></text>
        <font family="Verdana" bold="yes" size="10"/>
      </label>
    </no_data>
  </settings>
  <margin left="0" top="0" right="0" bottom="0" />
  <charts>
    <chart plot_type="Pie" name="chart_5892703801059068"> 
      <chart_settings>
        <title text_align="Center" position="Top" padding="0" >
          <text>Resolved calls</text>
          <font family="Tahoma" size="14" color="0x000000" />
        </title>
        <chart_background>
          <fill type="Solid" color="0xffffff" opacity="0" />
          <border enabled="false"/>
          <corners type="Square"/>
        </chart_background>
        <data_plot_background>

        </data_plot_background>

        <legend enabled="true" position="Right" align="Near" elements_layout="Vertical" ignore_auto_item="True">
          <title enabled="true">
            <text>Asset number</text>
            <font family="Arial" size="10" color="0x000000" />
          </title>
          <items>
            <item source="Points" />
          </items>
          <font family="Arial" size="10" color="0x000000" />
        </legend>

      </chart_settings>
      <data_plot_settings enable_3d_mode="false" >
        <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" /> 
          </tooltip_settings>
          <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="Arial" size="10" color="0x000000" />
          </label_settings>
          <pie_style>

          </pie_style>
          <marker_settings enabled="True" >
            <marker type="None" />
          </marker_settings>
          <connector color="Black" opacity="0.4"/>
        </pie_series>
      </data_plot_settings>

#DATA#
    </chart>
  </charts>
</anychart>
Re: Pie chart is showing ID number with , comma [message #551802 is a reply to message #551796] Fri, 20 April 2012 15:03 Go to previous messageGo to next message
Littlefoot
Messages: 19294
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I apologize, I didn't realize that it is a legend you are talking about.


Modify the <legend> section - add <format> which looks like this:
<format>{%Icon} {%Name}{numDecimals:0,thousandsSeparator:}</format>


Here (I separated it so that you'd easier notice where it is):
        <legend enabled="true" position="Right" align="Near" elements_layout="Vertical" ignore_auto_item="True">
          <title enabled="true">
            <text>Asset number</text>
            <font family="Arial" size="10" color="0x000000" />
          </title>
          <items>
            <item source="Points" />
          </items>
          <font family="Arial" size="10" color="0x000000" />
          

          <format>{%Icon} {%Name}{numDecimals:0,thousandsSeparator:}</format>


        </legend>


The result:

./fa/10077/0/

  • Attachment: legend.png
    (Size: 1.35KB, Downloaded 290 times)

[Updated on: Fri, 20 April 2012 15:04]

Report message to a moderator

Re: Pie chart is showing ID number with , comma [message #551847 is a reply to message #551802] Sat, 21 April 2012 08:08 Go to previous message
newprogrammerSQ
Messages: 48
Registered: April 2012
Member
thank you that fixed it Smile
Previous Topic: How to check apex version.
Next Topic: Call creation timestamp changes when record is opened again
Goto Forum:
  


Current Time: Tue Jul 22 11:23:18 CDT 2014

Total time taken to generate the page: 0.13523 seconds