Page 1 of 1

Problem supressing x-axis labels

Posted: Wed Feb 22, 2012 6:19 am
by 16859341
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]);

Re: Problem supressing x-axis labels

Posted: Wed Feb 22, 2012 9:52 am
by yeray
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.

Re: Problem supressing x-axis labels

Posted: Wed Feb 22, 2012 3:13 pm
by 16859341
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!

Re: Problem supressing x-axis labels

Posted: Wed Feb 22, 2012 4:22 pm
by yeray
Hi,

I'm glad to hear it solved the problem! :)