如何使用数据库查询图表数据 [英] how to do Using a Database Query for Chart Data

查看:126
本文介绍了如何使用数据库查询图表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

选择Faculty_Name =(从faculty = bfid选择教师的前1个facname),评分=('1'时的情况率然后''优秀''当''2''然后''好''时' '3''然后''公平'''4''然后''差''''0''然后''不适用''结束)

来自facfeedback




使用我的上述查询输出如下;



教师姓名等级



Suresh Good

Ramesh优秀

Vimal fair

Rajesh穷人





i希望使用csharp在asp.net中使用图形图表显示上述输出。



在x轴上我想显示学院名称



在y轴上我想显示评级



如何使用csharp在asp.net中使用图形图表显示。





运行模式屏幕如下;



F. rom Date Calendar1 To Date2



i有一个Listbox如下(在列表框中所有的院系名称都从DB中显示)



Suresh

Ramesh

Vimal

Rajesh



i选择从日期和日期,并在列表框中选择Faculty,然后单击生成图表按钮。他将数据显示在图表中。





当我点击Generate Char(按钮)时输出如下





好​​



优秀



Fair





Suresh Ramesh Vimal Rajesh



for the以上输出我可以得到如何使用数据库查询图表数据



select Faculty_Name = (select top 1 facname from faculty where facid = bfid), Rating = (case rate when ''1'' then ''Excellent'' when ''2'' then ''Good'' when ''3'' then ''Fair'' when ''4'' then ''Poor'' when ''0'' then ''Not Applicable'' end)
from facfeedback


using my above query output as follows;

Faculty Name Rating

Suresh Good
Ramesh Excellent
Vimal fair
Rajesh Poor


i want to show the above output using graphical chart in asp.net using csharp.

In x axis i want to show the Faculty Name

In y axis i want to show the Rating

how can i show using graphical chart in asp.net using csharp.


Run mode screen as follows;

From Date Calendar1 To Date Calendar2

i have one Listbox as follows(In listbox all the faculties name are displayed from the DB)

Suresh
Ramesh
Vimal
Rajesh

i select the from date and to date and select the Faculty in the Listbox and click the Generate Chart Button. he data to be displayed in chart.


ouput as follows when i click the Generate Char (Button)


Good

Excellent

Fair

Poor
Suresh Ramesh Vimal Rajesh

for the above output i can get how can i do using a Database Query for Chart Data

.

推荐答案

他们有很多图表可以显示你的数据。



http://jsfiddle.net/highcharts/KNGba/





在上面的链接中你可以看到如何实现它。
their are so many chart available to display you data.

http://jsfiddle.net/highcharts/KNGba/


in above link you can see how to implement it.


这篇关于如何使用数据库查询图表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆