Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to fix html5 bar chart plugins?

Tu NguyenAug 13 2020 — edited Aug 14 2020

Hi everyone,

There's an error with html5 bar chart plugins in Sample Charts (Apex default Sample App). The format mask property won't work.

I found this interesting to fix, because i know little about plugins and I want to learn something new. So this is what I've been digging:

In Pl/SQL code, they did create the display value and set the format mask for it:

...

C_VALUE_FORMAT_MASK CONSTANT VARCHAR2(4000) := P_REGION.ATTRIBUTE_21;

...

L_VALUE := APEX_PLUGIN_UTIL.ESCAPE (

               APEX_PLUGIN_UTIL.GET_VALUE_AS_VARCHAR2 (

                   P_DATA_TYPE => L_COLUMN_VALUE_LIST(L_VALUE_COLUMN_NUMBER).DATA_TYPE,

                   P_VALUE => L_COLUMN_VALUE_LIST(L_VALUE_COLUMN_NUMBER).VALUE_LIST(L_ROW_NUMBER)

               ),

               P_REGION.ESCAPE_OUTPUT

            );

      

            L_DISPLAY_VALUE :=

                CASE

                    WHEN C_VALUE_FORMAT_MASK IS NOT NULL THEN

                      to_char(to_number(L_VALUE),C_VALUE_FORMAT_MASK)

                    ELSE

                      L_VALUE

                END;

But when render data by js, maybe they forgot this, so Format Mask property wont work.

barValue = emptyStringIfUndefinedOrNullValue(pData.prefix_for_value) + (pData.display === "BAR_WIDTH" ? percent + "%" : pData.items[i].value) + emptyStringIfUndefinedOrNullValue(pData.postfix_for_value);

  valueBlockJqueryElement = jQuery(document.createElement("span")).addClass("a-BarChart-value").append(barValue).append(

  jQuery(document.createElement("span")).addClass("u-VisuallyHidden").append( (pData.display === "BAR_WIDTH" ? pData.items[i].value : percent + "%") )

  );

Still I don't know how to edit this JS file. There's no access to it.

Anyone please help?

Comments
Post Details
Added on Aug 13 2020
1 comment
250 views