i have a problem with chart column in c# , when i want to change text legend to take the x value , it show me this (#VALX) in the place of legend.
and this is my code in
chart1.DataSource = Remplir("SELECT count(*) AS Expr1, Candidat.Sourcing FROM Sourcing INNER JOIN Candidat ON Sourcing.Sourcing=Candidat.Sourcing GROUP BY Candidat.Sourcing");
chart1.Series.XValueMember = "Sourcing";
chart1.Series.YValueMembers = "Expr1";
chart1.Series.IsVisibleInLegend = true;
You have not given your
Name and your query doesn't supply one either. So you simply should insert this:
chart1.Series.Name = "Your Series Title";
Obviously you can only display one piece of text in a
Legend, not all X-Values!
If you want to keep the name and set the
Legend text independently, use the ``Series.LegendText` property:
chart1.Series.LegendText = "Your Series Legend Text";