Christoph's 2 Cents

A Backup for My Brain!

Oracle Application Express (Apex)Oracle Developement

Bug in Apex 4 when defining custom flash chart colors.

In Apex 4.1.1, when you specify custom colors in a Flash chart, and the custom color list contains blank spaces, Apex interprets these blanks into the %20 html character code. This is evident in the XML when viewed in debug mode.
I defined two custom colors with a blank space “RED, GREEN”, and the color inserted into the chart’s XML is “RED,%20GREEN”. Further, instead of parsing out the two colors, Apex thinks it is a single color name. Since the color name “RED,%20GREEN” does not exist, black is substituted.
Now if you define a long string of custom colors, you will end up with a long single color name:

[sourcecode language=”HTML”]BLUE,%20BLUEVIOLET,%20BROWN,%20CHARTREUSE,%20CORAL,%20CORNSILK,%20DARKORANGE,%20DEEPPINK,%20GOLD,%20GREEN[/sourcecode]

Of course apex/anycharts cannot handle that, therefore the resulting ORA-06502 error when trying to edit the chart.

I have tested this against Apex 3.1.2, and have not encountered the problem.

In order to reproduce the problem do the following:

  1. Create a new chart region with a 2D Line charts (other chart types may work as well, but i haven’t tested it).
  2.  For the chart series you can use anything, even “select null, 1, 1 from dual”
  3.  Change the Color Scheme to Custom
  4.  In the Custom Colors box add a list of more than ten colors with blank spaces after each comma. For example:#5D88F5, #E31DE3
  5. Run the chart
  6. Click the debug button
  7. Click the Show XML link.
  8. Note the color name in the series definition.
  9. Repeat, and in step 4 use a large number of colors:
    , #20FAFA, #54DEA0, #26A339, #CCE63A, #F9FF47, #D6913C, #E06421, #E65959, #BFA0BF, #2A450C
  10. The chart will fail completely, and will become uneditable. You’ll have to delete the chart region and start from scratch.

Update: This issue has been logged as a bug with Oracle.