My Labels OverLap
Posted: Mon Dec 02, 2013 10:15 pm
Hi there
I am adding a line to a Chart. Usually this is straightforward however, in this case I need to have the line plotted with the highest X-value at the left most
position on the X-Axis and the lowest X-value at the furthest point on the X-axis. ie. I need to reverse the labels.
As far as Im aware the only way I can get the labels to display correctly is by adding my own labels? Or is there an easy way?
Im coding in C#.NET and Ive used the code below to add the labels. This works. However the problem is the labels overlap if I reduce the width of the window.
Is there a setting that I can set to stop the labels overlapping. Ive tried playing about with "Separation" ie.
theChart.Axes.Bottom.Labels.Separation = 30;
but had no success.
Im guessing there is an easy solution to this??
-----------------------
int count1 = theChart.Series[0].XValues.Count;
theChart.Axes.Bottom.Labels.Items.Clear();
int z1 = 0;
while (z1 < count1)
{
string m = (count1 - z1).ToString();
theChart.Axes.Bottom.Labels.Items.Add(z1, m);
++z1;
}
I am adding a line to a Chart. Usually this is straightforward however, in this case I need to have the line plotted with the highest X-value at the left most
position on the X-Axis and the lowest X-value at the furthest point on the X-axis. ie. I need to reverse the labels.
As far as Im aware the only way I can get the labels to display correctly is by adding my own labels? Or is there an easy way?
Im coding in C#.NET and Ive used the code below to add the labels. This works. However the problem is the labels overlap if I reduce the width of the window.
Is there a setting that I can set to stop the labels overlapping. Ive tried playing about with "Separation" ie.
theChart.Axes.Bottom.Labels.Separation = 30;
but had no success.
Im guessing there is an easy solution to this??
-----------------------
int count1 = theChart.Series[0].XValues.Count;
theChart.Axes.Bottom.Labels.Items.Clear();
int z1 = 0;
while (z1 < count1)
{
string m = (count1 - z1).ToString();
theChart.Axes.Bottom.Labels.Items.Add(z1, m);
++z1;
}