I am having a problem labeling a chart axis in C# with the Microsoft Chart control. My label is the following string: "Elevation (m)". It works perfectly fine when labeling the x-axis. However, when I put the label on the y-axis, it displays as follows: "Elevation (m|". For some reason the ) displays as a |. Is this a bug or am I doing something wrong?
EDIT:
Here is my code:
DataTable dt1 = curve.GetCurveDataTableFromDatabase(); //Gets a datatable with columns Elevation and Storage
string seriesName = "Raw Data";
string xaxislabel = "Storage (m3)";
string yaxislabel = "Elevation (m)";
chartPlotArea.Series.Clear();
chartPlotArea.DataSource = dt1;
chartPlotArea.Series.Add(seriesName);
chartPlotArea.Series[seriesName].XValueMember = "Storage";
chartPlotArea.Series[seriesName].YValueMembers = "Elevation";
chartPlotArea.Series[seriesName].ChartType = SeriesChartType.Line;
chartPlotArea.ChartAreas[0].AxisX.Title = xaxislabel;
chartPlotArea.ChartAreas[0].AxisY.Title = yaxislabel;
chartPlotArea.Titles.Clear();
chartPlotArea.Titles.Add(new Title("Storage vs Elevation Plot"));
And here is what the chart looks like: enter image description here
string yaxislabel = "Elevation (m)";
) and retype it. (Don't copy and paste it.) - TaW