Page 1 of 1

Making left axis start at 0

Posted: Fri Nov 12, 2010 2:44 am
by 15354147
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);


Re: Making left axis start at 0

Posted: Fri Nov 12, 2010 8:33 am
by narcis
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);