I need to always display min-max values of custom Y-axis to a nearest rounded value. How can I do it?
Any help will be appreciated.
Min-max labels of custom vertical axis
Re: Min-max labels of custom vertical axis
Hello asupriya,
You can use a methods of Math class to around the min and max values. You can do something as next code:
Can you tell us, if this solution allow you do as you want?
I hope will helps.
Thanks,
You can use a methods of Math class to around the min and max values. You can do something as next code:
Code: Select all
Steema.TeeChart.Styles.Line line1 = new Line(tChart1.Chart);
Steema.TeeChart.Axis axis1 = new Steema.TeeChart.Axis(tChart1.Chart);
tChart1.Axes.Custom.Add(axis1);
line1.FillSampleValues(100);
line1.CustomVertAxis = axis1;
tChart1.Panel.MarginLeft = 10;
double max, min, max1,min1;
max= 100.5559;
min = 0.55559;
max1 = Math.Round(max);
min1 = Math.Round(min);
axis1.SetMinMax(min1, max1);
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: Min-max labels of custom vertical axis
Sandra,
Thanks for the reply. However, what I needed to know was about the labels of custom vertical axis. I successfully set the SetMinMax, but the labels on the min and max values of custom-axis are not being displayed. I need to have labels displayed on the min, max values.
Thanks for the reply. However, what I needed to know was about the labels of custom vertical axis. I successfully set the SetMinMax, but the labels on the min and max values of custom-axis are not being displayed. I need to have labels displayed on the min, max values.
Re: Min-max labels of custom vertical axis
Hello asupriya,
Ok. I think can help you use Minimum and Maximum offset as do in next simple example:
Can you tell us if previous serve you to achieves as you want?
I hope will helps.
Thanks,
Ok. I think can help you use Minimum and Maximum offset as do in next simple example:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Line(tChart1.Chart);
tChart1.Aspect.View3D = false;
tChart1.Panel.MarginLeft = 10;
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
line1.Add(i, rnd.Next(20));
}
Steema.TeeChart.Axis axis1 = new Steema.TeeChart.Axis(tChart1.Chart);
tChart1.Axes.Custom.Add(axis1);
line1.CustomVertAxis = axis1;
axis1.SetMinMax(1, 15);
axis1.MaximumOffset = 15;
axis1.MinimumOffset= 1;
axis1.AxisPen.Color = Color.Red;
}
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 |