Problem supressing x-axis labels

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kevino
Newbie
Newbie
Posts: 6
Joined: Mon May 16, 2011 12:00 am

Problem supressing x-axis labels

Post by kevino » Wed Feb 22, 2012 6:19 am

I have a chart that trends some bar data by date and in addition i add an additional series of bars to represent some calendar dates of interest (myBarSeries). They show up just fine on the chart, but have a bottom x-axis label problem when these co-exist with the data in the the other series. Essentially i want to keep the dates (i.e. mm/dd/yyyy) on the bottom axis and label the calendar events on the bar itself which the code below does very nicely. The problem is I also end up getting bottom x-axis labels as well but instead of labeling with the date, i see the "label" as provided which when mixed with the dates, makes for a real mess. I can't seem to find the right options to suppress the x-axis labeling while keeping labels on the bar (marks on bar)? any ideas?

myBarSeries := TBarSeries.Create(nil);
myBarSeries.Title := 'Calendar Events';
myBarSeries.XValues.DateTime := true;
myBarSeries.Marks.Visible := true;
myBarSeries.BarPen.Width := 2;
myBarSeries.Color := clyellow;
myBarSeries.MarksOnBar := true;
myBarSeries.Marks.Angle := 90;
myBarSeries.Marks.Transparent := true;
myBarSeries[b].ShowInLegend := true;

yMax := chartData.Axes.Left.Maximum;
if yMax = 0 then
yMax := 1;

while not qryEventData.Eof do
begin
myBarSeries[b].AddXY(qryEventData['start_date'], yMax, qryEventData['event_type'] );
qryEventData.Next;
end;
chartData.AddSeries(myBarSeries[b]);

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

Re: Problem supressing x-axis labels

Post by Yeray » Wed Feb 22, 2012 9:52 am

Hi,

If I understood well, you probably achieve it setting your bottom axis LabelStyle to talValue:

Code: Select all

Chart1.Axes.Bottom.LabelStyle:=talValue;
Or maybe with talPointValue, depending on the exact configuration. If this doesn't help, please try to 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

kevino
Newbie
Newbie
Posts: 6
Joined: Mon May 16, 2011 12:00 am

Re: Problem supressing x-axis labels

Post by kevino » Wed Feb 22, 2012 3:13 pm

mine was set to "auto". I changed it to Value and it seems to look right now... i'll do more testing, but this looks like the piece i missed. thanks!

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

Re: Problem supressing x-axis labels

Post by Yeray » Wed Feb 22, 2012 4:22 pm

Hi,

I'm glad to hear it solved the problem! :)
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