I have a TChart in which I dynamically create a set of TBarSeries, each one having a single bar value. I want to display in the bottom axis a string of text under each bar. I do this by adding custom labels to the chart BottomAxis:
Code: Select all
for i:=0 to NSeries-1 do
begin
Series:=TBarSeries.Create(Chart);
Series.AddXY(i,Values[i,0]);
Chart.BottomAxis.Items.Add(i,SeriesTitles[i]);
Series.ParentChart:=Chart;
end;
Code: Select all
with Chart do
for i:=0 to SeriesCount-1 do
if (Pos('1',Series[i].Title) <> 0) then // criteria that I'm using to decide wheter a series should be shown or not
begin
Series[i].Active:=true;
BottomAxis.Items[i].Format.Visible:=true;
end
else
begin
Series[i].Active:=false;
BottomAxis.Items[i].Format.Visible:=false;
end;
Chart.Refresh;
I think there should be some other BottomAxis property to be set to get the desired result, but I cannot find which one niether from help nor from examples.
Thank you very much for your help.
Piero