Hi,
We're experimenting with some label styles and like the fact that when using AxisLabelStyle.PointValue, axis labels are all lined up with the chart points.
We also like the fact that when using AxisLabelStyle.Value, axis labels are nicely spread along the axis. When there is not enough space, the interval between labels is increased, so that labels stay spread equally over the axis.
When there is not enough space when using AxisLabelStyle.PointValue however, individual labels are left out, depending on the available space, causing the labels not to be spread equally anymore.
What we're wondering now:
Is there an option to combine the behavior of both label styles, so that axis labels are still lined up with the chart points (AxisLabelStyle.PointValue), but when there is not enough space on the axis, to not hide individual labels, but just show 1 out of every 2, 3, 4,... labels, so that the labels are still spread nicely over the axis (AxisLabelStyle.Value)?
Equally spread axis labels
Equally spread axis labels
- Attachments
-
- AxisLabelStyle.Value - not enough space
- labels_value_notenoughspace.png (14.23 KiB) Viewed 12498 times
-
- AxisLabelStyle.PointValue - not enough space
- labels_pointvalue_notenoughspace.png (14.75 KiB) Viewed 12497 times
-
- AxisLabelStyle.PointValue - enough space
- labels_pointvalue_enoughspace.png (15.97 KiB) Viewed 12495 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Equally spread axis labels
A quick question - do you know if the gap between points, that is, the size of the TimeSpan between them, will be constant or not? If you cannot guarantee a constant gap value then your request is not going to be trivial to achieve.OMP wrote: Is there an option to combine the behavior of both label styles, so that axis labels are still lined up with the chart points (AxisLabelStyle.PointValue), but when there is not enough space on the axis, to not hide individual labels, but just show 1 out of every 2, 3, 4,... labels, so that the labels are still spread nicely over the axis (AxisLabelStyle.Value)?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Equally spread axis labels
Yes, we assume that the gap between 2 points will always be 1 week, so this is constant.Christopher wrote: A quick question - do you know if the gap between points, that is, the size of the TimeSpan between them, will be constant or not? If you cannot guarantee a constant gap value then your request is not going to be trivial to achieve.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Equally spread axis labels
Hello,
Apologies for the delay in my reply. I can see what you mean - I think the situation can be slightly bettered by setting the bottom axis' label angle to 90º, e.g.
but the gaps between the labels are still much bigger than when the Style is set to Auto. I have added this issue to our issue tracker with id=1801.
Apologies for the delay in my reply. I can see what you mean - I think the situation can be slightly bettered by setting the bottom axis' label angle to 90º, e.g.
Code: Select all
private void InitializeChart()
{
Line series = new Line(tChart1.Chart);
DateTime now = DateTime.Now;
Random rnd = new Random();
for (int i = 0; i < 50; i++)
{
series.Add(now, rnd.Next(1000));
now = now.AddDays(7);
}
tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yy hh:mm:ss";
tChart1.Axes.Bottom.Labels.Angle = 90;
tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.PointValue;
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Equally spread axis labels
No problem, thank you for the hint and for adding the issue to the issue tracker.Christopher wrote:Apologies for the delay in my reply. I can see what you mean - I think the situation can be slightly bettered by setting the bottom axis' label angle to 90º