Is there any way to ensure TeeChart draws the X and Y axes on a graph. In other words I need to display a vertical and horizontal line through the origin (0,0) of my Fastline chart.
Thanks
Rob
Drawing X and Y axes on chart
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Drawing X and Y axes on chart
Hi Rob,
maybe you have in mind something like this:
This can be achieved with code similar to this:
maybe you have in mind something like this:
This can be achieved with code similar to this:
Code: Select all
private void InitializeChart()
{
var forvel = new FastLine(tChart1.Chart);
var lines = File.ReadAllLines(@"D:\tmp\FastLine Data.csv").Skip(1)
.Select(x => x.Split(','))
.Select(x => x.Select(y => double.Parse(y)))
.Select(x => new { Time = x.ToArray()[0], Velocity = x.ToArray()[1], Force = x.ToArray()[2] }).ToArray();
forvel.Add(lines.Select(x => x.Velocity).ToArray(), lines.Select(y => y.Force).ToArray());
tChart1.Axes.Left.AxisPen.Visible = true;
tChart1.Axes.Left.PositionUnits = PositionUnits.Percent;
tChart1.Axes.Bottom.PositionUnits = PositionUnits.Percent;
tChart1.Axes.Left.RelativePosition = 50;
tChart1.Axes.Bottom.RelativePosition = 50;
tChart1.Axes.Left.SetMinMax(-2300, 2300);
tChart1.Axes.Bottom.SetMinMax(-3, 3);
}
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 |