Monday 11 November 2013

Oracle Apex 4 - Chart Legend Always Shows as Uppercase

I was recently developing an Oracle Apex 4 application with charts and found that the chart legend was always shown as uppercase text regardless of what was in the chart settings.

In Oracle Apex 3.1 all chart legends were converted to inital capitals so regardless of what text was entered the legend text always showed the first letter in capitals and the rest lower case. This behaviour was changed in APex 4 so I was surprised to find that all the legends were showing as upper case in this APex 4 application when the text entered was a mix of lower and upper case.

Fortunately this was a simple one to fix and the answer was that the text was not enclosed in double quotes. As soon as this was done the legend text for the Apex Chart was displayed correctly as mixed case rather than all upper case.

select null,
to_char(created_date,'MM-YY') Date,
sum(decode(TYPE,'SERVICE', 1,0)) Service ,
sum(decode(TYPE,'MAIN', 1,0)) Main

Showed on the chart legend as  SERVICE, MAIN but the code below showed correctly.

select null,
to_char(created_date,'MM-YY') "Date",
sum(decode(TYPE,'SERVICE', 1,0)) "Service" ,
sum(decode(TYPE,'MAIN', 1,0)) "Main"

Shows legend as required as Service and Main