Page 1 of 1

Vertical title not horizontally center-aligned

Posted: Sat Apr 27, 2013 9:25 am
by 17064597
too_near_axis.png
too_near_axis.png (6.73 KiB) Viewed 10466 times
The title is too near the left axis of my bar chart. How can I increase the distance some pixels?
More specifically, I would not consider the above to be center-aligned as the source code suggests. Is it a bug?

Re: Vertical title not horizontally center-aligned

Posted: Sat Apr 27, 2013 10:04 am
by 17064597
I changed to the following in Axis.java:

Code: Select all

else if ((angle > 0) && (angle <= 90))
{
    // KD:
    // x -= delta * (n + 1);
    x -= delta * (n + 1) + delta / 4;
    tmpAlign = StringAlignment.CENTER;
}
Not sure if it's 100% correct, but it works for my chart. Clearly, there is some error at that particular line! :)

Re: Vertical title not horizontally center-aligned

Posted: Tue Apr 30, 2013 2:59 pm
by yeray
Hi,

This is how a default chart looks for me.
device-2013-04-30-165417.png
device-2013-04-30-165417.png (5.56 KiB) Viewed 10404 times
I just set it to 2D and defined a left axis title:

Code: Select all

	private TChart tChart1;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		LinearLayout group = (LinearLayout) findViewById(R.id.chart_layout1);
		tChart1 = new TChart(this);
		group.addView(tChart1);

		tChart1.getAspect().setView3D(false);		
		tChart1.getAxes().getLeft().getTitle().setText("Left axis title");
	}
It may be some property you've set that could be relevant to reproduce it. Could you please arrange a simple example project we can run as-is to reproduce the situation here?