Hi,
when I have Axis.Automatic = true and there are two lines assigned to this axis and the first runs at y=1 and the second at y=3 then my axis min will be 1 and my max will be 3. The problem is when my series are just straight lines they are not visible because they are exactly at the borders of the chart. So i would need some kind of margin so that the min/max of the axis is always some pixels more than the actual min/max.
How can I do this? Is there a build-in functionality for this?
Axis.Automatic with a margin
Re: Axis.Automatic with a margin
Okay, I've found it! Axis.MinimumOffset & Axis.MaximumOffset do the job perfectly.
Re: Axis.Automatic with a margin
Hello ctusch,
I am glad that you found a solution for your problem .
Thanks,
I am glad that you found a solution for your problem .
Thanks,
Best Regards,
Sandra Pazos / 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: Axis.Automatic with a margin
Hello,
seems like I was too hasty. Axis.MinimumOffset & Axis.MaximumOffset work only when Axis.Automatic is set to false. That's a big problem as one of our customers needs automatic axis scaling. What can I do about this?
seems like I was too hasty. Axis.MinimumOffset & Axis.MaximumOffset work only when Axis.Automatic is set to false. That's a big problem as one of our customers needs automatic axis scaling. What can I do about this?
Re: Axis.Automatic with a margin
Hello ctusch,
I couldn't reproduce your problem using last version of TeeChart.Net and next code:
Please, check if previous code works as you want? If it doesn't work for you could you tell us which version of TeeChart.Net are you using.
Thanks,
I couldn't reproduce your problem using last version of TeeChart.Net and next code:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Line line1, line2;
Steema.TeeChart.TChart tChart1;
Steema.TeeChart.ChartController ChartController;
private void InitializeChart()
{
this.tChart1 = new Steema.TeeChart.TChart();
this.ChartController = new Steema.TeeChart.ChartController();
this.Controls.Add(tChart1);
this.Controls.Add(ChartController);
this.tChart1.Left = 100;
this.tChart1.Top = 50;
ChartController.Chart = tChart1;
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 10; i )
{
line1.Add(i, rnd.Next(10));
line2.Add(i, rnd.Next(10));
}
tChart1.Axes.Left.MinimumOffset = 50;
tChart1.Axes.Left.MaximumOffset = 70;
Thanks,
Best Regards,
Sandra Pazos / 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: Axis.Automatic with a margin
It doesn't work here, it looks like this:
I'm using version 3.5.3700.30575.Re: Axis.Automatic with a margin
Hello ctusch,
Your problem is solved in last version of TeeChart.Net (version 4) and in it version works correctly. For version 3 there are a workaround using StartPosition and EndPosition:
Could you please, tell us if previous code is a good solution for you?
I hope will helps.
Thanks,
Your problem is solved in last version of TeeChart.Net (version 4) and in it version works correctly. For version 3 there are a workaround using StartPosition and EndPosition:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Line line1, line2;
Steema.TeeChart.ChartController ChartController;
private void InitializeChart()
{
this.tChart1 = new Steema.TeeChart.TChart();
this.ChartController = new Steema.TeeChart.ChartController();
this.Controls.Add(tChart1);
this.Controls.Add(ChartController);
this.tChart1.Left = 100;
this.tChart1.Top = 50;
ChartController.Chart = tChart1;
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
line1.Add(i, rnd.Next(10));
line2.Add(i, rnd.Next(10));
}
tChart1.Axes.Left.StartPosition = 10;
tChart1.Axes.Left.EndPosition = 95;
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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: Axis.Automatic with a margin
Hello Sandra,
your workaround works, thanks for your help!
your workaround works, thanks for your help!