Hello,
The situation can be ameliorated by using manual values for the axis minimum and maximum values, e.g.
Code: Select all
private void InitializeChart()
{
tChart1.Axes.Bottom.Automatic = false;
tChart1.Axes.Bottom.Minimum = 0.0;
tChart1.Axes.Bottom.Maximum = 10.0;
var error1 = new Steema.TeeChart.Styles.Error(tChart1.Chart);
error1.SideMargins = false;
error1.ErrorStyle = Steema.TeeChart.Styles.ErrorStyles.LeftRight;
error1.Add(1.0, 5.0, 0.5);
tChart1.Series.Add(error1);
tChart1.Axes.Bottom.SetMinMax(error1.ErrorValues[0] * -1, error1.ErrorValues[0]);
}
Unfortunately, as highlighted in
this thread, there is a limitation in the Error series for bottom axis precision because the series itself modified minimum and maximum values in order to be able to draw itself, however, steps can be taken to redress this, e.g.
Code: Select all
private void InitializeChart()
{
var error1 = new Error(tChart1.Chart);
error1.ErrorStyle = Steema.TeeChart.Styles.ErrorStyles.LeftRight;
error1.Add(1.0, 5.0, 0.5);
tChart1.Series.Add(error1);
error1.CustomBarWidth = 200;
tChart1.Axes.Bottom.MaximumOffset = -(error1.CustomBarWidth / 10);
tChart1.Axes.Bottom.MinimumOffset = -(error1.CustomBarWidth / 10);
tChart1.Axes.Bottom.SetMinMax(0, 10);
}