Page 1 of 1

How to change chart empty space margins

Posted: Fri Jul 22, 2011 7:49 pm
by 15359204
I'm making a chart that plots n number of series, and each series has it's own custom axis. I would like to display all axes left of the chart area. The problem is, by the time I get to the third axis I've run out of room. I need to know how to increase the margin between the left of the component's graphical area and the actual chart so I can fit more axes in there.

Re: How to change chart empty space margins

Posted: Fri Jul 22, 2011 8:04 pm
by 15359204
Another related question, how do I get the color of the values on the axis to change? I see that I can do axis.getPen.setColor but that just changes the axis line color, not the values on it. The label color options doesn't work either.

Re: How to change chart empty space margins

Posted: Fri Jul 22, 2011 9:02 pm
by 15359204
I found solutions to both of my issues. Unfortunately there are not a lot of postings in the java forum, but once I searched the vcl forum I found hints to point me in the right direction pretty quickly. Posting the solutions here for others.

To change the margins you have to do chart1.getChart().getPanel().setMarginLeft(10) - where chart1 is your TChart object. This will set the left margin to 10% of the space of the chart. Pretty cool, took me forever to realize to use the get panel method.

To change the label color you have to do getLabels().getFont().setColor( *value*). Simply doing getLabels.setColor() doesn't seem to do anything.

Re: How to change chart empty space margins

Posted: Fri Jul 29, 2011 12:06 pm
by yeray
Hello mts,

Thanks for sharing the solutions.
mts wrote:I found solutions to both of my issues. Unfortunately there are not a lot of postings in the java forum, but once I searched the vcl forum I found hints to point me in the right direction pretty quickly.
Right, TeeChart Java is very young compared to the VCL, ActiveX and .NET versions but we try to make them as much equivalent as possible so searching in the whole forums is generally a good idea.
I hope that the TeeChart Java forums will grow with the recent TeeChart Java for Android and the next TeeChart Java 3.