X-Axis and Vertical Zoom Problems. I have created a stacked bar chart, setting self.owner.chart.BottomAxis.Automatic := True. I have the following problems:
1. The x-axis always displays the fourth rock type code, which I am unable to hide. Why is this and how do I hide this label? See attachment Label_On_XAxis.
2. The graph is always displayed in the centre of the x-axis. Is it possible to specify where the bar chart is located?
3. When I zoom, the chart always jumps to the left axis. Why is this and how do I prevent this? See attachments Zoom and After_Zoom.
4. Can I make the legend symbols higher without increasing the font. If I set self.Owner.Chart.Legend.Symbol.Continuous := True; the legend symbol height is increased for all but the first and last. Is it possible to increase the height for all symbols.
Note that the symbols at the left of the chart are drawn on a custom axis.
X-Axis and Vertical Zoom Problems
Re: X-Axis and Vertical Zoom Problems
Hi Errol,
Your last reply seems to treat completely different issues to the discussed in the thread where you posted it. That's why I split it into a new thread.
Please, try to open a new thread for each different issue or problem to report. This makes things easier for us and for anyone with a similar problem looking for the solution suggested.
We'll reply the inquiries asap.
Your last reply seems to treat completely different issues to the discussed in the thread where you posted it. That's why I split it into a new thread.
Please, try to open a new thread for each different issue or problem to report. This makes things easier for us and for anyone with a similar problem looking for the solution suggested.
We'll reply the inquiries asap.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: X-Axis and Vertical Zoom Problems
Hi Errol,
If you are doing something similar to the above, and you want to show no text in the bottom axis, you can use the OnGetAxisLabel as follows:
If you want to customize the symbols I'd suggest you to use the Legend.Symbol.OnDraw event as shown in the example at "All features\Welcome !\Miscellaneous\Legend\Symbol OnDraw" in the features demo program shipped with the installation.
Errol wrote:1. The x-axis always displays the fourth rock type code, which I am unable to hide. Why is this and how do I hide this label? See attachment Label_On_XAxis.
Code: Select all
Doing the following, I get "label 0" in the bottom axis label.
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=false;
Chart1.Legend.Alignment:=laBottom;
for i:=0 to 4 do
with Chart1.AddSeries(TBarSeries) as TBarSeries do
begin
Add(50+random*25, 'label ' + IntToStr(i));
MultiBar:=mbStacked;
MarksOnBar:=true;
MarksLocation:=mlCenter;
end;
end;
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=false;
Chart1.Legend.Alignment:=laBottom;
for i:=0 to 4 do
with Chart1.AddSeries(TBarSeries) as TBarSeries do
begin
Add(50+random*25, 'label ' + IntToStr(i));
MultiBar:=mbStacked;
MarksOnBar:=true;
MarksLocation:=mlCenter;
end;
Chart1.OnGetAxisLabel:=GetAxisLabel;
end;
procedure TForm1.GetAxisLabel(Sender:TChartAxis; Series:TChartSeries; ValueIndex:Integer; var LabelText:String);
begin
if Sender=Chart1.Axes.Bottom then
LabelText:='';
end;
Yes, playing with the bottom axis minimum and maximum properties. In the example above, we've added the values with the Add() method, specifying no XValue. Doing it this way, the XValue is generated by TeeChart and it is 0. Then, if you want to move the bar to the left, you can set a bottom axis minimum -1 and a maximum 2. Ie:Errol wrote:2. The graph is always displayed in the centre of the x-axis. Is it possible to specify where the bar chart is located?
Code: Select all
Chart1.Axes.Bottom.SetMinMax(-1, 2);
It won't happen any more if you implement the solution for the point above (2).Errol wrote:3. When I zoom, the chart always jumps to the left axis. Why is this and how do I prevent this? See attachments Zoom and After_Zoom.
Not exactly for me here. The first symbol height increases in its bottom and the last symbol height increases in its top. This is because this property is thought for the Left/Right alignments, not for the Top/Bottom.Errol wrote:4. Can I make the legend symbols higher without increasing the font. If I set self.Owner.Chart.Legend.Symbol.Continuous := True; the legend symbol height is increased for all but the first and last. Is it possible to increase the height for all symbols.
If you want to customize the symbols I'd suggest you to use the Legend.Symbol.OnDraw event as shown in the example at "All features\Welcome !\Miscellaneous\Legend\Symbol OnDraw" in the features demo program shipped with the installation.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: X-Axis and Vertical Zoom Problems
I wasn't sure of your policy re new threads. I will follow your suggestion in future.Yeray wrote:Hi Errol,
Your last reply seems to treat completely different issues to the discussed in the thread where you posted it. That's why I split it into a new thread.
Please, try to open a new thread for each different issue or problem to report. This makes things easier for us and for anyone with a similar problem looking for the solution suggested.
We'll reply the inquiries asap.
Re: X-Axis and Vertical Zoom Problems
I have successfully removed the X-Axis labels and placed the bar chart where required, as your suggestion to use SetMinMax - thanks. I had previously tried using Chart1.BottomAxis.Minimum and Chart1.BottomAxis.Maximum to set the axis range. The chart still moves around a bit on Zoom, so I wrote an OnZoom event to reset the X-axis Min and Max values each time.
By the way, I realized that my bar chart was located at position 4 on the x-axis as I have 3 other series on the chart (namely the symbols on the left axis).
Thanks and regards
Errol
By the way, I realized that my bar chart was located at position 4 on the x-axis as I have 3 other series on the chart (namely the symbols on the left axis).
Thanks and regards
Errol
Re: X-Axis and Vertical Zoom Problems
Hi Errol,
Thanks for understanding and for the information. I'm glad to hear you achieved to make it work as you wish.
Thanks for understanding and for the information. I'm glad to hear you achieved to make it work as you wish.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |