Vertical title not horizontally center-aligned

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Vertical title not horizontally center-aligned

Post by znakeeye » Sat Apr 27, 2013 9:25 am

too_near_axis.png
too_near_axis.png (6.73 KiB) Viewed 9337 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?

znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Re: Vertical title not horizontally center-aligned

Post by znakeeye » Sat Apr 27, 2013 10:04 am

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! :)

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Vertical title not horizontally center-aligned

Post by Yeray » Tue Apr 30, 2013 2:59 pm

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 9275 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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply