How to display red numbers on the X-axis
-
- Newbie
- Posts: 27
- Joined: Wed Nov 09, 2022 12:00 am
How to display red numbers on the X-axis
[img]C://Users//lyl//Desktop//222.png[/img]
How to display red numbers on the X-axis???
How to display red numbers on the X-axis???
- Attachments
-
- 222.png (136.64 KiB) Viewed 24367 times
Re: How to display red numbers on the X-axis
Hello,
If you want all the labels in the bottom axis to be red you can just set the Bottom axis
If you want only some labels in the bottom axis to be red, you have two options:
You can use the
Or you can use custom labels to achieve the same fine control and the same result. Ie:
If you want all the labels in the bottom axis to be red you can just set the Bottom axis
LabelsFont.Color
:Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Align:=alClient;
Chart1.Color:=clWhite;
Chart1.Gradient.Visible:=False;
Chart1.Walls.Back.Color:=clWhite;
Chart1.Walls.Back.Gradient.Visible:=False;
Chart1.View3D:=False;
Chart1.Legend.Hide;
Chart1.AddSeries(TFastLineSeries).FillSampleValues(10);
Chart1.Axes.Bottom.Title.Text:='Time (sec)';
Chart1.Axes.Bottom.LabelsFont.Color:=clRed;
end;
You can use the
OnDrawLabel
event to change the Bottom axis LabelsFont.Color
accordingly:Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Align:=alClient;
Chart1.Color:=clWhite;
Chart1.Gradient.Visible:=False;
Chart1.Walls.Back.Color:=clWhite;
Chart1.Walls.Back.Gradient.Visible:=False;
Chart1.View3D:=False;
Chart1.Legend.Hide;
Chart1.AddSeries(TFastLineSeries).FillSampleValues(11);
Chart1.Axes.Bottom.Title.Text:='Time (sec)';
Chart1.Axes.Bottom.OnDrawLabel:=BottomAxisDrawLabel
end;
procedure TForm1.BottomAxisDrawLabel(Sender:TChartAxis; var X,Y,Z:Integer; var Text:String; var DrawLabel:Boolean);
begin
if (Text<>'0') and (Text<>'10') then
Sender.LabelsFont.Color:=clRed
else
Sender.LabelsFont.Color:=clBlack;
end;
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.Align:=alClient;
Chart1.Color:=clWhite;
Chart1.Gradient.Visible:=False;
Chart1.Walls.Back.Color:=clWhite;
Chart1.Walls.Back.Gradient.Visible:=False;
Chart1.View3D:=False;
Chart1.Legend.Hide;
Chart1.AddSeries(TFastLineSeries).FillSampleValues(11);
Chart1.Axes.Bottom.Title.Text:='Time (sec)';
Chart1.Draw;
with Chart1.Axes.Bottom do
begin
Items.Automatic:=False;
for i:=0 to Items.Count-1 do
if (Items[i].Text<>'0') and (Items[i].Text<>'10') then
Items[i].Format.Font.Color:=clRed;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 27
- Joined: Wed Nov 09, 2022 12:00 am
Re: How to display red numbers on the X-axis
You misunderstood!!!
What I mean is that the X-axis now only displays 1, 5, and 10. How to make the X-axis display 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
That is to say, how to make the X-axis display more value text
What I mean is that the X-axis now only displays 1, 5, and 10. How to make the X-axis display 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
That is to say, how to make the X-axis display more value text
Re: How to display red numbers on the X-axis
Hello,
By default, the Axis
Did you change this setting?
You can change it again:
Or, if you want to force those labels, you can set it to
By default, the Axis
Increment
is set to 0
which automatically tries to fit as many labels as possible.Did you change this setting?
You can change it again:
Code: Select all
Chart1.Axes.Bottom.Increment:=0;
1
:
Code: Select all
Chart1.Axes.Bottom.Increment:=1;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 27
- Joined: Wed Nov 09, 2022 12:00 am
Re: How to display red numbers on the X-axis
[img]C://Users//ly//Desktop//333.png[/img]
This effect is not very good, it should be more. Can you modify your implementation process???
Chart1.Axes.Bottom.Increment:=0;
This effect is not very good, it should be more. Can you modify your implementation process???
Chart1.Axes.Bottom.Increment:=0;
-
- Newbie
- Posts: 27
- Joined: Wed Nov 09, 2022 12:00 am
Re: How to display red numbers on the X-axis
C://Users//lyl//Desktop//333.png
Re: How to display red numbers on the X-axis
Hello,
I see you still have troubles trying to attach your images.
I've improved my reply here about how to insert images to this forums.
I see you still have troubles trying to attach your images.
I've improved my reply here about how to insert images to this forums.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 27
- Joined: Wed Nov 09, 2022 12:00 am
Re: How to display red numbers on the X-axis
I have added the image to the attachment!
I suggest that you modify the insert image function to pop up a dialog box for users to select an image. This is a formal practice for many software applications.
I suggest that you modify the insert image function to pop up a dialog box for users to select an image. This is a formal practice for many software applications.
- Attachments
-
- 333.png (16.85 KiB) Viewed 24255 times
Re: How to display red numbers on the X-axis
Hello,
If you want labels at 0, 1, 2,..., and you want to force it so labels 0.5, 1, 1.5,... don't appear when zooming, you can set
Increment:=1
.You can press the "Add files" button in the "Attachments" tab to open the file explorer. I've edited the explanation here to mention it.wrote: ↑Fri Jun 30, 2023 3:21 amI suggest that you modify the insert image function to pop up a dialog box for users to select an image. This is a formal practice for many software applications.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 27
- Joined: Wed Nov 09, 2022 12:00 am
Re: How to display red numbers on the X-axis
It's not necessary to have an interval of 1. What I mean is whether it's possible to display as many numbers as possible during adaptation?
Re: How to display red numbers on the X-axis
Hello,
Try setting an
If you still find problems with it, please arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
Try setting an
Increment
of 0.5
, or to the minimum increment you want to support in your app.If you still find problems with it, please arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |