Hi support,
we use several custom axis in our application. And in some cases there are to many labels at the axis.
Is it possible to set a maximum of labels per axis? This would be better readable for the user especially if you have more than three y-axis.
If needed I can post an exampleimage.
Reduce the number of axis labels ?
Reduce the number of axis labels ?
Greetz Dominik
http://www.logview.info
http://www.logview.info
Hi Dominik,
Here you have different options:
- You could simply modify the PositionPercent of the axes:
- You could use OnGetAxisLabel event to change LabelText manually. But note that here you need to set LabelStyle to talText (so, your values must have labeltext set).
In the following example I hide the even values (in order of points addition to series).
Here you have different options:
- You could simply modify the PositionPercent of the axes:
Code: Select all
Chart1.MarginLeft := 15;
Chart1.CustomAxes[0].PositionPercent := -8;
Chart1.CustomAxes[1].PositionPercent := -16;
In the following example I hide the even values (in order of points addition to series).
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Axes.Left.LabelStyle := talText;
end;
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
if sender = Series1.GetVertAxis then
if (ValueIndex < 0) or (ValueIndex mod 2 = 0) then
LabelText := ''
else
LabelText := Series1.Labels[ValueIndex];
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Yeray,
I´ve tested your solutions but that´s not what I need ...
Your first solution is not useable. It just sets some margins to the chart and the Axis.
Your second solution won´t work for me.
But I found a "half" solution in the meantime. It helps alot if I set the minimum distance (in %) at 100% for the axis label.
But this is only one step and there are other problems. See the following picture:
I set the value format for both axis to #.##0,0 which is a common format in our application. If you have a big axis you will see double entries like on the picture.
This is really confusing for users.
So how can I disable the double values? It would be great if only the first one would be shown. So if yo have values like this:
it sould be display in this form:
Could you please give me an example how to achieve this?
I´ve tested your solutions but that´s not what I need ...
Your first solution is not useable. It just sets some margins to the chart and the Axis.
Your second solution won´t work for me.
But I found a "half" solution in the meantime. It helps alot if I set the minimum distance (in %) at 100% for the axis label.
But this is only one step and there are other problems. See the following picture:
I set the value format for both axis to #.##0,0 which is a common format in our application. If you have a big axis you will see double entries like on the picture.
This is really confusing for users.
So how can I disable the double values? It would be great if only the first one would be shown. So if yo have values like this:
Code: Select all
3,7
3,7
3,7
3,6
3,6
3,6
3,5
3,5
3,5
Code: Select all
<-- deleted
<-- deleted
3,7
<-- deleted
<-- deleted
3,6
<-- deleted
<-- deleted
3,5
Greetz Dominik
http://www.logview.info
http://www.logview.info
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Dominik,
You could try setting specific Increment depending on what's displayed on your chart. In the image you sent you could try setting Increment to 0.1 to remove the labels you mentioned.
You could try setting specific Increment depending on what's displayed on your chart. In the image you sent you could try setting Increment to 0.1 to remove the labels you mentioned.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |