Hi,
In the 2 images I have posted here, I need to figure out how to make the 1st label and 1st vertical line appear at the leftmost position of the graph regardless of the value.
I have also uploaded the project as well.
This 1st picture shows the discrepancy.
This picture is similar what it should look like - it should have a time mark under the rightmost edge of the graph as well.
Please note that this picture seems to be exactly what I need, however at any given time this is not what it looks like - (see Pic1).
Thanks for your assistance!
Bottom Axis Label Start Position
Bottom Axis Label Start Position
- Attachments
-
- BottomAxisTest.Zip
- (10.03 KiB) Downloaded 783 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Bottom Axis Label Start Position
Hello,
Do you mean something like this:
Do you mean something like this:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Line line1 = new Line(tChart1.Chart);
Random rnd = new Random();
DateTime today = DateTime.Today;
for (int i = 0; i < 20; i++)
{
line1.Add(today, rnd.Next(0, 1000));
today = today.AddDays(1);
}
tChart1.Axes.Bottom.Labels.Angle = 90;
tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yyyy";
tChart1.BeforeDrawAxes += TChart1_BeforeDrawAxes;
}
private void TChart1_BeforeDrawAxes(object sender, Graphics3D g)
{
Axis bottom = tChart1.Axes.Bottom;
AxisLabelsItems labels = bottom.Labels.Items;
double min = bottom.Minimum;
double max = bottom.Maximum;
double inc = 1; //one day
labels.Clear();
for (double i = min; i <= max; i+=inc)
{
labels.Add(i, DateTime.FromOADate(i).ToString(bottom.Labels.DateTimeFormat));
}
}
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 |