in Education by
I have two integer values ta and thc and I'm making the percentage calculation for these two values and pass these values to asp chart labels on each column as shown in the below code. while (myread2.Read()) { while (myread.Read()) { string ta1 = myread["totalapplied"].ToString(); string thc1 = myread2["THC"].ToString(); Int32 ta = Convert.ToInt32(ta1); Int32 thc = Convert.ToInt32(thc1); var calc = (((double)ta / (double)thc) * 100); string percentCalc = Convert.ToString(String.Format("{0:0.00}", calc)); // I want to pass this value for each column for each read on the loop lblcount.Text = myread["totalapplied"].ToString(); this.Chart1.Series["Series1"].Points.AddXY(myread["categ"], myread["totalapplied"]); this.Chart1.Series["Series1"].Legend = "Leg"; Chart1.Series["Series1"].IsValueShownAsLabel = true; Chart1.Series["Series1"].Label = percentCalc; //I need the calculated value here Chart1.Series["Series1"].ToolTip = "Shift: #VALX \\nCount: #VALY"; Chart1.Legends.Clear(); Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false; Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false; } this.Chart1.Series["Series2"].Points.AddXY(myread2["date1"], myread2["THC"]); this.Chart1.Series["Series2"].Legend = "Leg"; Chart1.Series["Series2"].IsValueShownAsLabel = true; Chart1.Series["Series2"].Label = "100%"; Chart1.Series["Series2"].ToolTip = "Shift: #VALX \\nCount: #VALY"; Chart1.Legends.Clear(); Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false; Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false; Chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1; Chart1.ChartAreas["ChartArea1"].AxisX.LabelStyle.Angle = -45; } con.Close(); So from the above code, it repeats the very last value of the loop to each and every column of the chart. How can I pass the individual calculations to the label? Thanks in advance... JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I think what you want is to add a custom label to your Series 1's points. Can you tell me if this works? Instead of this line of code: Chart1.Series["Series1"].Label = percentCalc; Try this Chart1.Series["Series1"].Points[Chart1.Series["Series1"].Points.Count-1].Label = percentCalc.ToString();

Related questions

0 votes
    I have a database (SQL Server) with clients and a MVC plataform, and i want a row to be "hidden ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a database (SQL Server) with clients and a MVC plataform, and i want a row to be "hidden ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I want put perfect percentage on each chart column as shown in fig in C# Windows Forms. How would ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    I want put perfect percentage on each chart column as shown in fig in C# Windows Forms. How would ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    For example, I have an ASP.NET form that is called by another aspx: string url = "http:// ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I know how to use the checkboxlist in ASP.NET to display options retrieved from a database. What I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I'm building an app using Visual Studio 2010. I can run my asp.net website from my computer (by ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    So the problem is i don't get get a value from textbox field on GridView RowUpdating event. Here ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I have a Login control placed inside LoginView control contained within a PANEL. I want to set login button ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I have tried many solution online but I am unable to fix. First off all i check in bin and it ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    i create this class and it have this constructor : public class ReturnResult : ImplicitReturnResult { public bool ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    Does Server Core 2008 support asp.net? I see references online saying that it isn't supported, but they ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
...