How does one add custom labels to the y-axis in place
of the y-axis values that would typically appear there?
How does one create custom y-axis labels?
Hi, Andy.
How about this:
There is also an example about this feature available in Teechart demo (custom axis labels).
An alternative solution is to use TChart OnGetAxis label event to change the existing axis labels.
How about this:
Code: Select all
With Chart1.Axes.Left do
begin
Items.Clear;
Items.Add(100,'ABC'); // add at 100.0 and also define custom label
Items.Add(150); // add at 150 and use this as axis label
Items.Add(164); // add at 164 and use this as axis label
end;
An alternative solution is to use TChart OnGetAxis label event to change the existing axis labels.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
I have used something like this for annotating the axis directly from the fixed part (first line) of a stringgrid :
GridCoord is a TGridRect (type) variable. So it is possible to specify a part of a stringgrid and to visualise it without knowing which part the user will choose at runtime.
Chart1.BottomAxis.Items.Clear;
Chart1.BottomAxis.Automatic := True;
for RunnerX := GridCoord.Left to GridCoord.Right do Chart1.BottomAxis.Items.Add (RunnerX-GridCoord.Left, ResultStringGrid.Cells[RunnerX, 0]);
GridCoord is a TGridRect (type) variable. So it is possible to specify a part of a stringgrid and to visualise it without knowing which part the user will choose at runtime.
Chart1.BottomAxis.Items.Clear;
Chart1.BottomAxis.Automatic := True;
for RunnerX := GridCoord.Left to GridCoord.Right do Chart1.BottomAxis.Items.Add (RunnerX-GridCoord.Left, ResultStringGrid.Cells[RunnerX, 0]);