Making left axis start at 0

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
ZooX
Newbie
Newbie
Posts: 18
Joined: Tue Aug 25, 2009 12:00 am

Making left axis start at 0

Post by ZooX » Fri Nov 12, 2010 2:44 am

I can not figure what I am doing wrong. I have a Line chart in which the lowest value in the data is 5000 but I want the left axis to start at 0. I have tried all of the following and none of them work. Are these even the right place to set the starting number for the axis?

Code: Select all


		tChart.getAxes().getLeft().setMinimum(0);
		tChart.getAxes().getBottom().setMinimum(0);
		tChart.getAxes().getRight().setMinimum(0);
		tChart.getAxes().getTop().setMinimum(0);


Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Making left axis start at 0

Post by Narcís » Fri Nov 12, 2010 8:33 am

Hi ZooX,

You need to set AutomaticMinimum to false before. If you use SetMinMax method it's not necessary to set AutomaticMinimun or AutomaticMaximum.

Code: Select all

        com.steema.teechart.styles.Line line1 = new com.steema.teechart.styles.Line(tChart1.getChart());

        for (int i = 0; i < 10; i++) {
            line1.add(5000 + i* 1000);
        }

        tChart1.getAxes().getLeft().setAutomaticMinimum(false);
        tChart1.getAxes().getLeft().setMinimum(0);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply