Hello,
I have a single Chart where I am creating Box Chart Plots. I have two functions that construct the series and assign them to the charts. I have 15 series in each chart which I create in a loop. Also in the loop I give values to the XLabel property. The functions are almost identical. The looping is identical.
In the chart created from one function all the XLabel values appear under the ticks under the box plots. But in the other chart, the last 5 XLabels do not appear. The Box plots appear, but not the labels. The X axis is identical in both charts. Same number of series, same label values.
Can you give me some suggestions on what might be causing this. I've been over and over it and can see no reason why all 15 Labels appear on the X axis for one chart and the last five disappear on the other chart.
Thanks very much.
Hardee Mahoney
Washington, DC
All TBoxSeries.XLabel do not appear on the chart along the X
Hi.
It's hard to tell but I'd say the problem is horizontal axis pixel size is not the same in both cases and drawing algorithm decides to skip some labels to avoid overlapping. To fix this problem, try settingh the axis LabelSeparation property to small value (for example, 1). This should force TeeChart into displaying all labels. Another thing you might try is rotate axis labels to 90 deg to reduce the number of pixels per axis label (in horizontal direction).
It's hard to tell but I'd say the problem is horizontal axis pixel size is not the same in both cases and drawing algorithm decides to skip some labels to avoid overlapping. To fix this problem, try settingh the axis LabelSeparation property to small value (for example, 1). This should force TeeChart into displaying all labels. Another thing you might try is rotate axis labels to 90 deg to reduce the number of pixels per axis label (in horizontal direction).
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
I am still not able to get all the labels on the bottom axis for a series of box charts to print. I've tried setting the labelSeparation property to 1, and setting the labels to alternate. On the chart the first 10 labels print and not the last four. Visually it seems there is plenty of room for the last four labels. There is just blank space. Even though it works fine on one set of data and not on another I wonder if I understand the XLabel for a Box plot properly. I am using code that looks like this (simplified)
Also, I have another chart where the title of the left axis is written on top of the axis tick labels. I can't seem to find out how to move the title.
Thanks
Hardee Mahoney
Washington, DC
Code: Select all
for GridNo := 0 to FAPVResults.NumPoolingWindows - 1 do
begin
BoxSeries := TBoxSeries.Create(self);
BoxSeries.ParentChart := Chart1;
BoxSeries.Position := GridNo;
BoxSeries.Clear;
for i := 0 to 100 do
begin
...
end;
BoxSeries.UseCustomValues := true;
BoxSeries.AdjacentPoint1 :=
BoxSeries.AdjacentPoint3 :=
BoxSeries.Quartile1 :=
BoxSeries.Quartile3 :=
BoxSeries.Median :=
BoxSeries.Innerfence1 :=
BoxSeries.Innerfence3 :=
BoxSeries.Outerfence1 :=
BoxSeries.Outerfence3 :=
BoxSeries.ExtrOut.Visible := false;
BoxSeries.MildOut.Visible := false;
BoxSeries.Title := SeriesLabel(GridNo);
BoxSeries.XLabel[GridNo] := SeriesLabel(GridNo);
end;
Also, I have another chart where the title of the left axis is written on top of the axis tick labels. I can't seem to find out how to move the title.
Thanks
Hardee Mahoney
Washington, DC
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Hardee,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi.
The XLabels are associated to single series and if this series has less points than XLabels, you'll end up with wrong result. Single boxplot series displays one single box at speicific x position meaning you'll only be able to control single axis label. The correct way to display series titles as bottom axis labels would be to use the following code:
The XLabels are associated to single series and if this series has less points than XLabels, you'll end up with wrong result. Single boxplot series displays one single box at speicific x position meaning you'll only be able to control single axis label. The correct way to display series titles as bottom axis labels would be to use the following code:
Code: Select all
var i: Integer;
begin
// assuming all series in chart SeriesList are box series
with Chart1.Axes.Bottom.Items do
begin
Clear;
for i := 0 to Chart1.SeriesCount -1 do
Add((Chart1[i] as TBoxSeries).Position,Chart1[i].Title);
end;
end;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Re: All TBoxSeries.XLabel do not appear on the chart along the X
Nice tip, working well
TY.
TY.