简体   繁体   English

Oracle Apex 4.2图表因问题悬停

[英]Oracle Apex 4.2 Chart hoover over issue

I have build a chart for one of the departments: 我已经为其中一个部门建立了图表:

select 'f?p=&APP_ID.:802:'||:app_session||'::::P802_ENQ_DATE:'|| e.enq_date ||':'  link, 
cal_date as label,
 value1 as value 
from 
(select cal_date from time
where cal_date >= '01-'||:P802_SEARCH_MONTH and
cal_date <= last_day(to_date('01-'||:P802_SEARCH_MONTH, 'dd-mm-yy')) 

 ) t

LEFT OUTER JOIN

(SELECT
a.enquired_date AS enq_date,
COUNT(a.id) AS value1
FROM
ENQUIRY a 
group by a.enquired_date
) e 
ON
to_char(e.enq_date) = to_char(t.cal_date)
order by label ASC

The requirement was to present number of daily enquiries in selected by end user month.So :P802_SEARCH_MONTH captures name of the month and pass this parameter to time table. 要求是显示最终用户月份选择的每日查询数量。因此:P802_SEARCH_MONTH捕获月份的名称并将此参数传递到时间表。 Time table stores all possible date days, then chart adds up all enquiries per day and throw joins them with dates. 时间表存储了所有可能的日期天,然后图表将每天的所有查询相加,并将它们与日期联系起来。 It is important to show all possible dates as in some days there was not any enquiries and if it would be the other way round it would not display full date range. 重要的是要显示所有可能的日期,因为在某些日子中没有任何查询,如果相反,它将不显示完整的日期范围。

Anyhow, when you hoover over the bar of the chart it shows 'label' 无论如何,当您将鼠标悬停在图表的条形图上时,它会显示“标签”

在此处输入图片说明

I have requirement to include name of the day into the label.I tried extending 't' statement: 我要求将日期名称添加到标签中。我尝试扩展“ t”语句:

    select 'f?p=&APP_ID.:802:'||:app_session||'::::P802_ENQ_DATE:'|| e.enq_date ||':'  link, 
full_date as label,
 value1 as value 
from 
    (select to_char(to_date(cal_date,'dd-mon-yy'), 'DAY')||' - '|| cal_Date as full_date from time
    where cal_date >= '01-'||:P802_SEARCH_MONTH and
    cal_date <= last_day(to_date('01-'||:P802_SEARCH_MONTH, 'dd-mm-yy')) 

     ) t

this does not work. 这行不通。 Apex is not throwing any meaningful errors. Apex没有引发任何有意义的错误。 Any help greatly appreciated. 任何帮助,不胜感激。

Don't change your source query, t . 不要更改源查询t Is cal_date a DATE column? cal_date是DATE列吗? (i presume it is indeed a date column) (我认为确实是日期列)

to_char(to_date(cal_date,'dd-mon-yy'), 'DAY')

If it is then you cast a date to a date and then apply a format mask. 如果是,则将日期转换为日期,然后应用格式掩码。 Don't cast dates to dates. 不要将日期强制转换为日期。 It already is a date. 已经是约会了。
Be careful with date conversion aswell. 还要注意日期转换。 In apex you should always work with explicit format masks and not rely on implicit conversion - this will come back and haunt you some day otherwise. 在apex中,您应该始终使用显式格式掩码,而不要依赖隐式转换-否则,这会回来并且困扰您一天。

You need to alter the LABEL column 您需要更改LABEL

cal_date as label,

This will be the tooltip value. 这将是工具提示值。 Right now you are returning a DATE and that is what you see when you hover over the datapoint. 现在,您将返回一个DATE,这就是将鼠标悬停在数据点上时看到的内容。 The database's format mask is simply applied to it. 数据库的格式掩码仅适用于它。
If you want to change it then you can just apply a format mask to the date and show that in the tooltip. 如果要更改日期,则可以对日期应用格式掩码,并在工具提示中显示它。

select 'f?p=...' AS link, 
       TO_CHAR(cal_date, 'DAY') || ' - ' || cal_date AS label,
       value1 AS value 
from ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM