我想以11g形式显示饼图。因此,我编写了这段代码。图表正在显示,但是使用此代码,只有第一行填充了图表。这意味着如果查询检索到两行,例如-
gen emp
--- ----
male 5
female 3
然后图表根据第一行(男性5)的数据显示100%。
这是我的代码:
declare
cursor graph1 is
SELECT GENDER GEN,COUNT(*) EMP
FROM EMP_INFO
GROUP BY GENDER
ORDER BY 2 DESC;
vd varchar2(1):=',';
begin
go_block('control1');
clear_record;
first_record;
for j in graph1 loop
SET_CUSTOM_PROPERTY('control1.b_g',1,'ADD_ROWDATA','Gender'||VD||J.EMP||VD||j.GEN);
SET_CUSTOM_PROPERTY('control1.b_g',1,'ADD_DATA_TO_GRAPH','AREA_VERT_ABS');
SET_CUSTOM_PROPERTY('control1.b_g',1,'GRAPHTYPE','PIE_GRAPH');
SET_CUSTOM_PROPERTY('control1.b_g',1,'MOUSEACTION','FALSE');
SET_CUSTOM_PROPERTY('control1.b_g',1,'SET_BACKGROUND','0,255,255');
SET_CUSTOM_PROPERTY('control.b_g',1,'SHOW_GRAPH','');
end loop;
end;