如何使用图表显示数据 [英] how to display data using graphical chart

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

问题描述

选择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中使用图形图表显示。





运行模式屏幕如下;





从日期日历1到日期日历2



i有一个列表框如下(在列表框中,所有的院系名称都从数据库中显示)



Suresh
Ramesh

Vimal

Rajesh



然后我有一个按钮生成图表。当我clcik生成图表按钮时,数据将显示在图表中。







好​​



优秀



公平



差< br $>


Suresh Ramesh Vimal Rajesh







我怎么能用图形图表显示。



请帮帮我。



问候,

Narasiman P.

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

Then i have one button Generate Chart. when i clcik the Generate Chart Button the data to be displayed in chart.



Good

Excellent

Fair

Poor

Suresh Ramesh Vimal Rajesh



for that how can i show using graphical chart.

Please help me.

regards,
Narasiman P.

推荐答案

使用Asp Chart控件并分别添加列名,如下所示

然后绑定你的图表。在代码后面就像你绑定其他控件一样。



Use the Asp Chart control and add the column name respectively as shown below
Then Bind ur chart. in code behind like u bind for other controls.

<div class="divChart">
       <asp:chart id="Chart1" runat="server" palette="SemiTransparent" xmlns:asp="#unknown">
           BackImageAlignment="Center" BackImageTransparentColor="Transparent">
           <series>
               <asp:series name="GraphicalChart" xvaluemember="FacultyName" isvalueshownaslabel="true">
                   YValueMembers="Rating">
               </asp:series>
           </series>
           <Titles>
               <asp:title text="Your Rating Name">
               </asp:title>
           </Titles>
           <legends>
               <asp:legend name="Rating Scale" title="Rating Scale" alignment="Near" backcolor="Azure">
               </asp:legend>
           </legends>
           <chartareas>
               <asp:chartarea name="ChartArea1">
                   <axisx title="faculty Name">
                       <majorgrid enabled="false" />
                   </axisx>
                   <axisy title="Rating">
                       <majorgrid enabled="false" />
                   </axisy>
               </asp:chartarea>
           </chartareas>
       </asp:chart>
   </div>


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

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