Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using ASP.NET Chart control.
while executing i am getting the below error.
Error : "Y values cannot be data bound to the string object.Parameter name: yValues"
What is the problem in the above error.

See my code:
-------------
If dtable.Rows.Count > 0 Then
Dim xvalue As New List(Of String)()
Dim yvalue As New List(Of String)()
For i As Integer = 0 To dtable.Rows.Count - 1
xvalue.Add(dtable.Rows(i)("Emp_ID"))
yvalue.Add(dtable.Rows(i)("Section"))
Next
Dim xvalues As String() = xvalue.ToArray
Dim yValues As String() = yvalue.ToArray
Chart1.Series("ColChart").Points.DataBindXY(xvalues, yValues)
''Error displaying here -Y values cannot be data bound to the
string object.

End if
Posted

1 solution

hi;

Please try like this!

VB
For Each drow As DataRow in dtable.Rows()
   points.AddY(drow("someitem"))
Next
 
Share this answer
 
Comments
gani7787 17-Jan-12 7:50am    
what about x-axis range..?
How to handle x-axis range...?
Ipshita Sharma 14-Jul-12 3:25am    
x axis value ?

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