Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,
In my project to display student marks details into barcharts/pie charts can u guide or send any snippets
Posted

1 solution

XML
<asp:Chart ID="classrc" runat="server"  Width="1000px"  Height="500px"  Visible="false" BorderlineColor="Black" BorderlineDashStyle="Solid"  >
                <Titles>
                <asp:Title Name="Average Read Correctly" Text="Read Correctly" >
             </asp:Title>
               </Titles>
                             <Series>
                                 <asp:Series Name="Series1"  Color="#eb4619"  >

                                 </asp:Series>

                             <ChartAreas>
                                 <asp:ChartArea Name="ChartArea1">
                                 <AxisX  Interval="1"><MajorGrid Enabled="False" /></AxisX>
                                 <AxisY Interval="20" ><MajorGrid Enabled="False" /></AxisY>

                                 </asp:ChartArea>
                             </ChartAreas>
                         </asp:Chart>


Add the data table as a source to chart like this

C#
classrc.DataSource = dataTable;
                classrc.Series["Series1"].XValueMember = "Name";
                classrc.Series["Series1"].ToolTip = "Name:#AXISLABEL , Avg RC: #VALY";
                classrc.Series["Series1"].YValueMembers = "AvgRC";
 
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