How do I show both the bottom and top axis on my chart? I want to show a 6hr increment on the bottom axis and a day increment on the top.
It only shows the bottom axis.
var bottomAxis = tChart.Axes.Bottom;
bottomAxis.Automatic = true;
bottomAxis.Ticks.Length = 1;
bottomAxis.RelativePosition = 0;
bottomAxis.MinorGrid.Visible = false;
bottomAxis.MinorTicks.Visible = false;
bottomAxis.Grid.Visible = false;
bottomAxis.Labels.DateTimeFormat = "hh:mm tt";
bottomAxis.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.SixHours);
var topAxis = tChart.Axes.Top;
topAxis.Automatic = true;
topAxis.Ticks.Length = 1;
topAxis.Visible = true;
topAxis.RelativePosition = 0;
topAxis.MinorGrid.Visible = false;
topAxis.MinorTicks.Visible = false;
topAxis.Grid.Visible = true;
topAxis.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneDay);
topAxis.Labels.DateTimeFormat = "d MMM";
Top and Bottom Axis
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Top and Bottom Axis
Hello,
You should be able to use e.g.:
You should be able to use e.g.:
Code: Select all
private void InitializeChart()
{
Line series = new Line(tChart1.Chart);
series.FillSampleValues();
series.HorizAxis = HorizontalAxis.Both;
}
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: Top and Bottom Axis
Thanks, it worked once I added the line you suggested - series.HorizAxis = HorizontalAxis.Both;