Solved

horizontal bar chart in APEX

Posted on 2010-09-12
5
1,656 Views
Last Modified: 2013-12-07
Hi All,

I need to create a horizontal bar chart in oracle APEX.In it i need to show payments on x axis and companies on y Axis.it is very easy to plot such horizontal bar charts.But now reuirements have become complex and now i need to show 12 horizontal lines for each company showing payments for each month of the year.

I am not getting this option in APEX please suggest how can i do it.I am using APEX 3.2

Thanks a lot for all the experts.
0
Comment
Question by:oracle_rookie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 33661794
put each month in its own series

January would look like this...

select null,company,sum(payment_amount) payments from your_table
where payment_time >= trunc(sysdate,'yyyy')
and payment_time < add_months(trunc(sysdate,'yyyy'),1)
group by company
order by company

February would look like this...

select null,company,sum(payment_amount) payments from your_table
where payment_time >= add_months(trunc(sysdate,'yyyy'),1)
and payment_time < add_months(trunc(sysdate,'yyyy'),2)
group by company
order by company

then just increment the add_months  amount for each of the other series queries

0
 

Author Comment

by:oracle_rookie
ID: 33668139
hi,

Thanks for such a detailed explanation.I think the below chart will work for me:

http://anychart.com/products/anychart/gallery/sample_43.html

Also in my code i am putting year in where condition and i have extracted month and year from date in two separate coloumns.So please let me know what i need to write in my case.

because in this chart on y axis there will be company names in place of p1,p2,p3.......

and  there will be 12 series for each corresponding company value.Now will you please guide me how i can make this chart.Also i need to show in the right hand side the month with the color mentioned.

This may be very easy but i am working on Apex first time that's why i am asking such simple questiond.

Once again thanks for your valuable reply.

Regards,
Shyam
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 33671291
so you have two columns of numbers like this?

Year    Month
2000      1
2000      2
2001      2
2001      6
2002      3
2002      12

If so, your queries become easier

where year = to_number(to_char(sysdate,'yyyy'))
and month = 1 -- or 2 or 3 or 4 etc

if you have a year field that users can select rather than using current year

just put that in instead of "to_char(sysdate,'yyyy')"

you will still have 12 series though,  one series for each month

your legend will be based on the column name of chart data


select null,company,sum(payment_amount) january from your_table
where year = to_number(to_char(sysdate,'yyyy'))
and month = 1
group by company
order by company

select null,company,sum(payment_amount) february from your_table
where year = to_number(to_char(sysdate,'yyyy'))
and month = 2
group by company
order by company



0
 

Author Comment

by:oracle_rookie
ID: 33673301
Hi sdstuber,

Thanks for your help.I have done my job by your guidance.You have given a perfect solution.Thanks A lot.

Now i will ask another question related to hyperlinking the coloumns items in reports and by clicking on them user navigates to another page where the details behind that number appears.I will ask this question separately.Please help in that also.

Once again thanks alot.

Thanks
0
 

Author Comment

by:oracle_rookie
ID: 33678805
Hi Dear,

Will you please tell me how i can make the format of values shown on x axis of payment to dollar and standard comma format.I am not getting this option in Apex 3.2
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question