* I use TeeChart 8.0.4 Pro with Delphi 2009 to display candle stick series.
* I use DateValues = False for x values and controls the labels manually.
Three questions -
1. How do I add the date line when I use time for the labels ? You can see in the image attached.
The date should have a tick mark and text below the regular x labels.
2. I use TCursorTool to add a horizontal line to the graph, can I make it be behind my candles BUT before the grid lines ?
3. Now with Line Series graph - When I add points to the graph which are not monospaced (on x) a grid lines are created,
can I control the frequency of the y grid lines ? (so they will be mono spaced)
PS - I tries to attach an image but didnt find a way Is there any?
Thanks for your help
Adding dates as a second line to a candle sticks graph
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
The easiest way is setting axes DateTimeFormat like this:1. How do I add the date line when I use time for the labels ? You can see in the image attached.
The date should have a tick mark and text below the regular x labels.
Code: Select all
Chart1.Axes.Bottom.DateTimeFormat:='hh:mm:ss' + #13 + '|' + #13 + 'MM/dd';
Chart1.MarginBottom:=7;
In that case you'd better use TColorLineTool which has DrawBehind property:2. I use TCursorTool to add a horizontal line to the graph, can I make it be behind my candles BUT before the grid lines ?
Code: Select all
ChartTool1.Axis:=Chart1.Axes.Left;
ChartTool1.Value:=6;
ChartTool1.DrawBehind:=true;
Yes. Grid lines depend on axis labels. You can set axis labels like this:3. Now with Line Series graph - When I add points to the graph which are not monospaced (on x) a grid lines are created,
can I control the frequency of the y grid lines ? (so they will be mono spaced)
Code: Select all
Series1.AddXY(0, 5, 'point 1');
Series1.AddXY(2, 7, 'point 1');
Series1.AddXY(3, 2, 'point 1');
Series1.AddXY(5, 8, 'point 1');
Chart1.Axes.Bottom.LabelStyle:=talValue;
You can send us your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.PS - I tries to attach an image but didnt find a way Is there any?
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 |
Display a date only once per new day
I have implemented your suggestion but have a new issue.
Now every label has time and date parts.
I would like that the date part will be displayed only once per a new day, this will reduce redundant information to the user.
Of course when I say once per a new day I mean once per a new DISPLAYED day, so if because zooming option that label isn't display than the next should display the date.
How can I accomplish that ?
I will upload - 'ShimonInvestSoftDateOnePerDay.png' so you can understand easily my needs.
Thanks!
Now every label has time and date parts.
I would like that the date part will be displayed only once per a new day, this will reduce redundant information to the user.
Of course when I say once per a new day I mean once per a new DISPLAYED day, so if because zooming option that label isn't display than the next should display the date.
How can I accomplish that ?
I will upload - 'ShimonInvestSoftDateOnePerDay.png' so you can understand easily my needs.
Thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
You should set DateTime Increment to one day as told in Tutorial 4 - Axis Control. You'll find tutorials at TeeChart's program group.
You should set DateTime Increment to one day as told in Tutorial 4 - Axis Control. You'll find tutorials at TeeChart's program group.
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 |
Narcís thanks for your prompt reply.
But you didn't understand what I meant.
I have uploaded a new image to clarify : ShimonInvestSoftDateOnePerDay_Goal.png
I wouldn't like to change the increment and to keep it auto, but I would like it to display the date part only when strictly needed.
For example if values are (22:00 19/11), (23:00 19:/11) (0:00 20/11)
Display should be
22:00 23:00 00:00
19/11 (nothing) 20/11
Thanks
But you didn't understand what I meant.
I have uploaded a new image to clarify : ShimonInvestSoftDateOnePerDay_Goal.png
I wouldn't like to change the increment and to keep it auto, but I would like it to display the date part only when strictly needed.
For example if values are (22:00 19/11), (23:00 19:/11) (0:00 20/11)
Display should be
22:00 23:00 00:00
19/11 (nothing) 20/11
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
Sorry. Ok, now I see what you mean. In that case you should use the OnGetAxisLabel event and manually LabelText to fit your needs.
Sorry. Ok, now I see what you mean. In that case you should use the OnGetAxisLabel event and manually LabelText to fit your needs.
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 |
The OnGetAxisLabel is called for all the VALUES in the range > min and < max my X (bottom axis).
BUT not ALL VALUES are DISPLAYED because of overlapping and zoom options and size of text...
So if I will set only one label within the day with the date (e.g. '21:23' + #13 + '11-30') then it might (because of zoom) not be displayed and there will be a day which does not appear.
Any solution?
BUT not ALL VALUES are DISPLAYED because of overlapping and zoom options and size of text...
So if I will set only one label within the day with the date (e.g. '21:23' + #13 + '11-30') then it might (because of zoom) not be displayed and there will be a day which does not appear.
Any solution?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
OnGetAxisLabel event is also called when zooming/unzooming so I'd set labels as suggested in my first reply and dynamically customize them on each chart paint:
Alternativelly you can use custom labels as shown in the All Features\Welcome!\Axes\Labels\Custom Labels in the new features demo, available at TeeChart's program group.
OnGetAxisLabel event is also called when zooming/unzooming so I'd set labels as suggested in my first reply and dynamically customize them on each chart paint:
Code: Select all
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
if Sender = Chart1.Axes.Bottom then
begin
LabelText:=ParseYourLabelsHere(LabelText);
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 |