Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

How to customize ojet Chart boxplot sort by median

User_RPM7NMar 10 2021 — edited Mar 10 2021

Hello,
is there a way (except via SQL) to sort a boxplot by median or other values ?
actually we do this by SQL like this:
1)we calculate the median in sql with the MEDIAN function
2)we add spaces before the labels with lpad.......
with basis as(
select lbl, val from(
select 'world' lbl, round(DBMS_RANDOM.value*100) as val from dual connect by level< 1000)
union all
select 'hello' lbl, round(DBMS_RANDOM.value*75) as val from dual connect by level< 100)
select sorthelp.lbl, b.val
FROM
basis b ,
(
select
med,
lpAd(' ',row_number () over (order by med ,' '))|| lbl as lbl
from
(select distinct median(val) over(partition by lbl ) med,lbl
from basis)
)sorthelp
where trim(b.lbl) = trim(sorthelp.lbl)
====================================
this solution is not really satisfying, because of the complexity of our SQLs
Does anybody know another way?

  1. perhaps inside the Advanced JavaScript Initialization Code
    OR
    perhaps after refresh ?
    (a simple call like this can't be the solution, because a boxplot has several values:
    $("#our_chart_jet").ojChart({sorting:'descending'});)

========================
MANY THANKS

This post has been answered by Oleh Tyshchenko on Mar 12 2021
Jump to Answer
Comments
Post Details
Added on Mar 10 2021
4 comments
95 views