1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Chart issue in apex 4.2

Discussion in 'Oracle Application Express (APEX)' started by Bharat, Jun 8, 2015.

  1. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi All,

    We have an requirement that X-Axis should show the Date and Y-Axis should show 0 to 48 range with 4 interval (like 0,4,8,12,..48) and values should be count of number of Sales Orders records for that date shown on the X-Axis. Is this possible to achieve in APEX ?
     
  2. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    I managed to get the date to show after converting it via TO_CHAR. Need a sample?

    CJ
     
  3. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Yes CJ, please can you provide an sample of it, it will be helpful for us to do it faster.
     
  4. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Alrighty then...I have a view where I do the following the date column:

    to_char(revdate, 'YYYY-Q') as "Quarter"

    Then, for the Flash chart query :

    select null link
    , "Quarter" label
    , "Total" "ProjectName"
    from closedqtr2
    where ... blah blah blah

    So basically, all I did was convert the date to a string and then select it. The date quarters show up along the bottom of the chart and the numbers go up the left.

    HTH

    CJ
     
  5. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi CJ,

    Yes got it with the Date on X-Axis. But how can we achieve the following:

    Now on particular date we need to check now many sales orders are created based on the Quantity.

    If the 5 sales orders are created on 10-Jun-2015 with 10 quantity and
    another 5 sales orders are created on 10-Jun-2015 with 20 quantity.
    Our Graph as to show like on Y-Axis we should populate 0 to 100 with 10 interval.. And there after we have to check on particular date how many sales orders are created by grouping the date and quantity.

    So on Y-Axis we have to show 0,10,20,30,40,..100 (10 interval) This is nothing but Quantity Booked. If we have 5 Sales Orders with 10 quantity, then our graph has to show point (value = 5) at Y-Axis point 10.
     
  6. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Doesn't your query have that total as the 3rd column?
     
  7. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    For our Chart Query we will have the following 3 columns.

    select null link, to_char(ordered_date,'dd-Mon-yy') label, count(distinct order_number) val from ...... group by ordered_date

    So above is the query I have used. Now whats happening in the graph is
    on x-axis date and on y-axis count of orders on that date.

    Now I wanted to count the orders based on the group of Quantity. Like for 4, 8,12,16 we need to plot the graph.

    If quantity is 4 and having 4 orders it has to plot on X-Axis as 11-Jun-15 and on Y-Axis ranges has to show (0,4,8,12,16,20,24 so on) and have to plot value 4 at range 4.
     
  8. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Short of creating a view first and then charting off of that...I don't believe that's possible. APEX is going to chart based on the data that's there so if you have an order for 7 items...it'll show just that.

    I suspect you have little to no control over the data points in the Y-Axis, in fact, IMO the Y-Axis seems to rely on the MAX value in your data set. Then it does some odd math to create a random Y-axis label based on the data you gave it...hence the notion of creating a view first.

    Create a random chart with some counts to plot and run it...then triple the data and run it again and you'll see the Y-Axis label 'adjust' due to the increased counts.

    HTH

    CJ
     
  9. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi CJ,

    Do you have any example or any web site which contains this kind of issue ? By that it will be helpful to do.
     
  10. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
  11. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    I don't see the discussion on this Issue CJ. Can you please provide the example URL.
     
  12. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    This talks about dates and spacing on the X-Axis :

    https://community.oracle.com/message/6505852#6505852

    Whether the same concept can be applied to the Y-Axis is not something I've tried...I'm not even sure you can.

    This also has a discussion on the spacing vs the data on the X-Axis...same caveats hold true for the Y-Axis:

    https://community.oracle.com/message/1427491#1427491

    I also found this link which has a bunch of examples :

    http://apex.oracle.com/pls/apex/f?p=36648:1:4056620940408338::NO:::&tz=-4:00

    ...but again, I still think the manipulation of the specific gridpoints on the Y-axis is out of your control.

    HTH

    CJ