Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<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
Posted

1 solution

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. Software Engineer
Seed Management Services Pvt ltd.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900