我有一个学生标记Xml文件,,,,所以我想将一个排名前五位的图表显示成图表。 [英] I Have A Students Marks Xml File,,,,So I Want To Display A Chart With Top Five Scorers Into A Graph.

查看:64
本文介绍了我有一个学生标记Xml文件,,,,所以我想将一个排名前五位的图表显示成图表。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< cd>

< studentname> Empire Burlesque

< rollno> 112242

< country> USA

< state> Columbia

< totalmarks> 100

< acquiredmarks> 85

< year> 1985 < br $> b $ b

< cd>

< studentname>隐藏你的心

< rollno> 112241
< country> UK

< state> CBS记录

< totalmarks> 100

< acquiredmarks> 75

< year> 1988



< cd>

< studentname> Greatest Hits
< rollno> 112245

< country> USA

< state> RCA

< totalmarks> 100

<得出的标签> 65

< year> 1982



< cd>

< studentname>仍然有蓝调

< rollno&g t; 112241

< country> UK

< state>处女记录

< totalmarks> 100

<获得标记> 65

< year> 1990

<cd>
<studentname>Empire Burlesque
<rollno>112242
<country>USA
<state>Columbia
<totalmarks>100
<obtainedmarks>85
<year>1985

<cd>
<studentname>Hide your heart
<rollno>112241
<country>UK
<state>CBS Records
<totalmarks>100
<obtainedmarks>75
<year>1988

<cd>
<studentname>Greatest Hits
<rollno>112245
<country>USA
<state>RCA
<totalmarks>100
<obtainedmarks>65
<year>1982

<cd>
<studentname>Still got the blues
<rollno>112241
<country>UK
<state>Virgin records
<totalmarks>100
<obtainedmarks>65
<year>1990

推荐答案

你好会员11305067352,
$ b以下$ b是c#语言中的代码,我认为这有助于解决您的问题。





hello Member 11305067352,
below is ur code in c# language,i think this will help your problem.


protected void Button1_Click(object sender, System.EventArgs e)
{
    DataSet ds = new DataSet();
    //Read xml data to the dataset
    ds.ReadXml("YourXMLDocPath in .xml format");
    //code used for verifying necessary strings
    //Response.Write(ds.Tables(0).Columns(0).ColumnName.ToString())
    //Response.Write(ds.Tables(0).Columns(1).ColumnName.ToString())
    /*Here you can put your logic for top 5 score as per condition(use lamda expression on dataset for filtering your data),*/
    YourChart.DataSource = ds;
    YourChart.Series("Series1").XValueMember = ds.Tables(0).Columns(1).ColumnName.ToString();
    YourChart.Series("Series1").YValueMembers = ds.Tables(0).Columns(2).ColumnName.ToString();
    YourChart.Series.Add("Series2");
    YourChart.Series("Series2").XValueMember = ds.Tables(0).Columns(1).ColumnName.ToString();
    YourChart.Series("Series2").YValueMembers = ds.Tables(0).Columns(3).ColumnName.ToString();
    YourChart.Series(0).Color = Drawing.Color.Red;
    YourChart.Series(1).Color = Drawing.Color.Blue;
    YourChart.ChartAreas("ChartArea1").AxisX.Interval = 1;
    YourChart.DataBind();

}





Aditya Prakash

jr。软件工程师

种子管理服务私人有限公司



Aditya Prakash
jr. Software Engineer
Seed Management Services Pvt ltd.


这篇关于我有一个学生标记Xml文件,,,,所以我想将一个排名前五位的图表显示成图表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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