with dmAllWeb.ADOQuery3 do
begin
SQL.Clear;
SQL.Add('select * from table where 代码 = ' + '''600000''');
Open;
end; DBChart1.Series[0].DataSource := dmAllWeb.ADOQuery3;以上代码得到一个表: 日期 代码 散户 中户 大户 法人 机构
20080322 600000 2.9 1.3 1 43.9 50.9如何将以上这个表用通过柱状图表现出来,每个柱子分别表示:散户 中户 大户 法人 机构,
散户 + 中户+ 大户 + 法人 + 机构 = 100, 纵坐标的刻度最大值就是100.
我用以下代码不用实现。
DBChart1.Series[0].YValues.ValueSource := '代码';
DBChart1.Series[0].XValues.ValueSource := '散户';
DBChart1.Series[0].XValues.ValueSource := '中户';
DBChart1.Series[0].XValues.ValueSource := '大户';
DBChart1.Series[0].XValues.ValueSource := '法人';
DBChart1.Series[0].XValues.ValueSource := '机构';
解决方案 »
- delphi 支持开发sql server ce同步功能吗?
- 一个很奇怪的问题,请高手帮助!
- 各位前辈,怎样做一个计时自动关机的程序?谢谢!
- 关于服务器adocon的连接问题
- 关于ODBC的问题!急!!!在线等!!!(shylsz)
- 简单的问题,超高分!!!
- 有谁用过flatstyle控件,它的按钮没有onkeydown方法,请问有没有办法加上
- delphi 如何备份sql server数据库,请高手赐教!
- 如何表示3,256,765.30?
- 菜鸟问题3:checkbox控件和radiobutton控件可不可以设置成不要边框,平面的,edit控件可以设置,但是这两个我找不到在什么地方设置
- sql语句多个参数传递的问题?????
- 女同事
个人觉得你的表应该是这样的:
类型 数值
散户 2.9
中户 1.3
大户 1
法人 43.9
机构 50.9 SQL.Clear;
SQL.Add('select 类型,数值 from table where 代码 = ' + '''600000'''');
SQL.Add(' GROUP BY 类型') ;
open;
dbchart_tjjg.Series[0].Active:=false;
dbchart_tjjg.Series[0].DataSource:=ADOQuery3;
dbchart_tjjg.Series[0].XLabelsSource:='类型';
dbchart_tjjg.Series[0].YValues.ValueSource:='数值';
dbchart_tjjg.Series[0].Active:=true;
select * from
(
select 代码 as stockCodeName , 日期 as date, Subject = '散户' , Result = 散户 from #a
union all
select 代码 as stockCodeName , 日期 as date, Subject = '中户' , Result = 中户 from #a
union all
select 代码 as stockCodeName , 日期 as date, Subject = '大户' , Result = 大户 from #a
union all
select 代码 as stockCodeName , 日期 as date, Subject = '法人' , Result = 法人 from #a
union all
select 代码 as stockCodeName , 日期 as date, Subject = '机构' , Result = 机构 from #a
) t
order by stockCodeName, date, case Subject when '散户' then 1 when '中户' then 2 when '大户' then 3 when '法人' then 4 when '机构' then 5 end
select * from
(
select 代码 as stockCodeName , 日期 as date, Subject = '散户户数' , Result = 散户户数 from #a
union all
select 代码 as stockCodeName , 日期 as date, Subject = '法人户数' , Result = 法人户数 from #a
union all
select 代码 as stockCodeName , 日期 as date, Subject = '机构户数' , Result = 机构户数 from #a
) t
order by stockCodeName, date, case Subject when '散户户数' then 1 when '法人户数' then 2 when '机构户数' then 3 end