How to change chart empty space margins
How to change chart empty space margins
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
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
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.
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
Hello mts,
Thanks for sharing the solutions.
I hope that the TeeChart Java forums will grow with the recent TeeChart Java for Android and the next TeeChart Java 3.
Thanks for sharing the solutions.
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.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.
I hope that the TeeChart Java forums will grow with the recent TeeChart Java for Android and the next TeeChart Java 3.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |