Top and Bottom Axis
Posted: Mon Mar 13, 2017 3:42 am
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";
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";