Hello,
On certain dates I measure a value.
I have 5 dates for my x axis. Every date has its value on the left axis.
Everything is displayed fine but the intervals between the dates are calculated and then displayed. I want them to be regular. That is, if the interval between the dates in days is 10, 20, 30 and 40 I want the visual distance equally devided in parts of 25.
How can I do this?
I use Tchart V5 pro.
Dates in bottom axis in regular intervals
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rob,
I'm not sure about what you are trying to achieve here but have you tried setting axes increment? For example:
I'm not sure about what you are trying to achieve here but have you tried setting axes increment? For example:
Code: Select all
Chart1.Axes.Bottom.Increment:=25;
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 |
Hello Narcis,
I'm sorry, I did not explain it properly. The intervals are just examples, the real intervals are random. If I have 10 dates I want all 10 of them evenly ditributed on the graph, not representing their place on a timeline. Furthermore, the bottom axis displays random dates (every first) instead of the real dates (the proper dates are in the Data)
Some more details: the graph is a horizontal line, in Series Datasource Label has TotalErrors (representing the counting), the X axis has Date, the Y axis had TotalErrors. See images
I'm sorry, I did not explain it properly. The intervals are just examples, the real intervals are random. If I have 10 dates I want all 10 of them evenly ditributed on the graph, not representing their place on a timeline. Furthermore, the bottom axis displays random dates (every first) instead of the real dates (the proper dates are in the Data)
Some more details: the graph is a horizontal line, in Series Datasource Label has TotalErrors (representing the counting), the X axis has Date, the Y axis had TotalErrors. See images
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rob,
Thanks for the information.
To achieve what you request you should populate your series like in the code snippet below. Here points are evenly spaced because only Y values are added to the series, X values are automatically added and range from 0 to MyLine.Count-1. That's why points are evenly spaced. To have dates displayed in the bottom axis labels we just need to add them as labels for each point, instead of X values, and set series marks to display Y values.
Thanks for the information.
To achieve what you request you should populate your series like in the code snippet below. Here points are evenly spaced because only Y values are added to the series, X values are automatically added and range from 0 to MyLine.Count-1. That's why points are evenly spaced. To have dates displayed in the bottom axis labels we just need to add them as labels for each point, instead of X values, and set series marks to display Y values.
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var MyLine: TLineSeries;
begin
MyLine:=TLineSeries.Create(self);
Chart1.AddSeries(MyLine);
With MyLine do
begin
Marks.Visible:=true;
Marks.Style:=smsValue;
Add(17, '14-5-05');
Add(16, '9-7-05');
Add(27, '3-9-05');
Add(22, '11-9-05');
Add(16, '29-10-05');
Add(14, '22-12-05');
Add(17, '23-2-06');
Add(16, '19-3-06');
Add(24, '20-4-06');
Add(16, '14-7-06');
end;
end;
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 |