使用C#显示在asp.net中显示到图表中的gridview记录 [英] showing the gridview records displayed into the chart in asp.net using C#
问题描述
注意:它是网络应用程序。
来自Gridview记录如何使用图表显示。
Gridview中的
记录如下;
BFid Rate < br $>
1 25
2 50
3 75
4 100 >
1 50
2 75
i希望使用图表显示上述记录关闭
示例如下所示,显示在图表中的网格视图记录如下
100
75
25
>
1 1 2 3 4
从上面的网格视图记录中我想显示使用图表如下所示
x轴b $ b我希望从gridview中显示Bfid
在y轴i想要从gridview显示Rate
我怎么能用c#使用asp.net。
问候,
Narasiman P.
假设您要创建折线图,您可以使用以下代码创建图表控件:
< asp:chart id = ChartRate runat = server height = 400px width = 800px xmlns:asp = #unknown >
< series >
< asp :series xvaluemember = 日期 isvalueshownaslabel = true yvaluemembers = 呼叫计数 >
Name =Series1ChartType =LineColor =GreenIsVisibleInLegend =trueBorderWidth =1>
< / asp:series >
< / series >
< borderskin backcolor = 白色 bordercolor = 黑色 skin 样式 = 浮雕 / >
< chartareas >
< asp :chartarea 名称 = ChartArea1 borderwidth = 0 >
< axisy 标题 = BfId in terval = 5 > < / axisy >
< axisx title = 评分 > < / axisx >
< / asp:chartarea < span class =code-keyword>>
< / chartareas >
< / asp:chart >
在Code Behind中,您可以直接将此图表绑定到图表控件中的数据集
ChartRate.DataSource = dsRate.Tables [ 0 ]; // 在此处指定gridview的数据源。
ChartRate.DataBind();
欲了解更多信息,请查看以下链接:
如何在ASP.Net 3.5图表工具中创建条形图和折线图 [ ^ ]
Note : it is web application.
From Gridview records how to display using chart.
in Gridview records as follows;
BFid Rate
1 25
2 50
3 75
4 100
1 50
2 75
i want to display the above records using chart as follows
Example as follows showing the grid view records displayed into the chart as follows
100
75
50
25
1 1 2 3 4
From the above grid view records i want to display the using chart as follows
in x axis i want to display the Bfid from the gridview
in y axis i want to display the Rate from the gridview
for that how can i do using asp.net using c#.
Regards,
Narasiman P.
Assuming you want to create a line chart, you can create the chart control using following code:
<asp:chart id="ChartRate" runat="server" height="400px" width="800px" xmlns:asp="#unknown"> <series> <asp:series xvaluemember="Date" isvalueshownaslabel="true" yvaluemembers="Call count"> Name="Series1" ChartType="Line" Color="Green" IsVisibleInLegend="true" BorderWidth="1"> </asp:series> </series> <borderskin backcolor="White" bordercolor="Black" skinstyle="Emboss" /> <chartareas> <asp:chartarea name="ChartArea1" borderwidth="0"> <axisy title="BfId" interval="5"></axisy> <axisx title="Rate"></axisx> </asp:chartarea> </chartareas> </asp:chart>
In Code Behind you can directly bind this chart to Dataset in Chart Control
ChartRate.DataSource = dsRate.Tables[0]; // Assign here your gridview's data source. ChartRate.DataBind();
For more information look at the following links:
How to Create Bar Chart and Line Chart both in ASP.Net 3.5 Charting Tools[^]
这篇关于使用C#显示在asp.net中显示到图表中的gridview记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!