Crosshair - add to CHART?
Crosshair - add to CHART?
Hi,
is it possible to add a crosshair not to a series, but to a chart?
Please see the screenshot: It has a crosshair tool added to the candle series.
Its vertical line does not reach the function series, which would be interesting to compare.
See red circle around the "not reaching".
So my question: is it possible to have a crosshair to 2 series or to a chart or to a series including its function?
Thanks,
Cheryll
is it possible to add a crosshair not to a series, but to a chart?
Please see the screenshot: It has a crosshair tool added to the candle series.
Its vertical line does not reach the function series, which would be interesting to compare.
See red circle around the "not reaching".
So my question: is it possible to have a crosshair to 2 series or to a chart or to a series including its function?
Thanks,
Cheryll
- Attachments
-
- ChartCrosshair.jpg (56.16 KiB) Viewed 17883 times
Cheryll
Re: Crosshair - add to CHART?
Hi Cheryll,
I can't reproduce the problem here. What TeeChart version are you using?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
I can't reproduce the problem here. What TeeChart version are you using?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Crosshair - add to CHART?
Hi,
everything default, done in half a minute:
Add a candlestick series, fill it with sample data.
Then add e.g. the RSI function and the cross-hair tool.
You will (probalby) see, that the crosshair will look "short" / not reach the RSI series - as on my screenshot.
This is normal for the tool / functions. At least for me.
For this reason I asked, what I can do as an alternavtive for a vertical line above ALL series.
I use TeeChart Pro v2012/13 VCL version.
Regards,
Cheryll
everything default, done in half a minute:
Add a candlestick series, fill it with sample data.
Then add e.g. the RSI function and the cross-hair tool.
You will (probalby) see, that the crosshair will look "short" / not reach the RSI series - as on my screenshot.
This is normal for the tool / functions. At least for me.
For this reason I asked, what I can do as an alternavtive for a vertical line above ALL series.
I use TeeChart Pro v2012/13 VCL version.
Regards,
Cheryll
Cheryll
Re: Crosshair - add to CHART?
Hi Cheryll,
Gives me this chart:
Can you please try the code above?
Does it work fine for you?
Do you see it's doing anything very different to what you explained?
I must be missing some setting because this code:Chartist wrote:everything default, done in half a minute:
Add a candlestick series, fill it with sample data.
Then add e.g. the RSI function and the cross-hair tool.
You will (probalby) see, that the crosshair will look "short" / not reach the RSI series - as on my screenshot.
This is normal for the tool / functions. At least for me.
Code: Select all
uses Chart, CandleCh, Series, TeeTools;
var Chart1: TChart;
candle1: TCandleSeries;
line1: TLineSeries;
rsiFunc1: TRSIFunction;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Align:=alClient;
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
candle1:=Chart1.AddSeries(TCandleSeries) as TCandleSeries;
candle1.FillSampleValues;
line1:=Chart1.AddSeries(TLineSeries) as TLineSeries;
rsiFunc1:=TRSIFunction.Create(Self);
line1.SetFunction(rsiFunc1);
line1.DataSource:=candle1;
Chart1.Tools.Add(TCursorTool);
end;
Does it work fine for you?
Do you see it's doing anything very different to what you explained?
You could also try with TColorLineTool.Chartist wrote:For this reason I asked, what I can do as an alternavtive for a vertical line above ALL series.
I've tried the code above with different TeeChart versions (2012.05, 2012.06, 2012.07, 2013.08, 2013.09, 2014.10 and 2014.11) and I always got the cursor from the top to the bottom of the chart.Chartist wrote:I use TeeChart Pro v2012/13 VCL version.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Crosshair - add to CHART?
Hi,
how times fly!
This thing is that long on my ToDo list.
Thank you for your reply.
Du you think, it has to do something with the scaling?
I cannot "remove" it, because by removing these lines, I remove the lower part, where the vertical line shall pass through.
I wrote this in my code.
original
DBChart_A_Kontrakt.Axes.Left.EndPosition:=100 - SubChartProzent;
for you to understand
SubChartProzent:=15;
DBChart_1.Axes.Left.EndPosition:=100 - SubChartProzent;
=> this shall make, that the main chart takes a space from 85% from above. And the subchart takes 15% at the lower edge of my chart.
Warm Regards,
Cheryll
how times fly!
This thing is that long on my ToDo list.
Thank you for your reply.
Du you think, it has to do something with the scaling?
I cannot "remove" it, because by removing these lines, I remove the lower part, where the vertical line shall pass through.
I wrote this in my code.
original
DBChart_A_Kontrakt.Axes.Left.EndPosition:=100 - SubChartProzent;
for you to understand
SubChartProzent:=15;
DBChart_1.Axes.Left.EndPosition:=100 - SubChartProzent;
=> this shall make, that the main chart takes a space from 85% from above. And the subchart takes 15% at the lower edge of my chart.
Warm Regards,
Cheryll
Cheryll
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Crosshair - add to CHART?
Hi Cherryl,
I'm sorry but I don't understand what you mean. Could you please send a Short, Self Contained, Correct (Compilable), Example project to reproduce the problem here?
Thanks in advance.
I'm sorry but I don't understand what you mean. Could you please send a Short, Self Contained, Correct (Compilable), Example project to reproduce the problem here?
Thanks in advance.
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 |
Re: Crosshair - add to CHART?
Thank you for your reply.
This is hard, but not impossible with your help. The thing is, that with YOUR code, I cannot do what done with my code (listed above).
So I started a new form and if you allow we try to meet on this base. The project reads this (nothing but your above example fit into my form Form_MPs):
procedure TForm_MPs.erzeugen; //FormCreate(Sender: TObject);
begin
Application.CreateForm(TForm_MPs, Form_MPs);
Chart_MP:=TChart.Create(Form_MPs);
Chart_MP.Parent:=Form_MPs;
Chart_MP.Align:=alClient;
Chart_MP.View3D:=false;
Chart_MP.Legend.Visible:=false;
candle1:=Chart_MP.AddSeries(TCandleSeries) as TCandleSeries;
candle1.FillSampleValues;
line1:=Chart_MP.AddSeries(TLineSeries) as TLineSeries;
rsiFunc1:=TRSIFunction.Create(Self);
line1.SetFunction(rsiFunc1);
line1.DataSource:=candle1;
Chart_MP.Tools.Add(TCursorTool);
Form_MPs.BringToFront;
Form_MPs.Show;
end;
What I cannot do is the scaling. I make you a screenshot to show you WHICH scaling.
Sincerely,
Cheryll
This is hard, but not impossible with your help. The thing is, that with YOUR code, I cannot do what done with my code (listed above).
So I started a new form and if you allow we try to meet on this base. The project reads this (nothing but your above example fit into my form Form_MPs):
procedure TForm_MPs.erzeugen; //FormCreate(Sender: TObject);
begin
Application.CreateForm(TForm_MPs, Form_MPs);
Chart_MP:=TChart.Create(Form_MPs);
Chart_MP.Parent:=Form_MPs;
Chart_MP.Align:=alClient;
Chart_MP.View3D:=false;
Chart_MP.Legend.Visible:=false;
candle1:=Chart_MP.AddSeries(TCandleSeries) as TCandleSeries;
candle1.FillSampleValues;
line1:=Chart_MP.AddSeries(TLineSeries) as TLineSeries;
rsiFunc1:=TRSIFunction.Create(Self);
line1.SetFunction(rsiFunc1);
line1.DataSource:=candle1;
Chart_MP.Tools.Add(TCursorTool);
Form_MPs.BringToFront;
Form_MPs.Show;
end;
What I cannot do is the scaling. I make you a screenshot to show you WHICH scaling.
Sincerely,
Cheryll
- Attachments
-
- Crosshair_Project.jpg (201.14 KiB) Viewed 17660 times
Cheryll
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Crosshair - add to CHART?
Hi Cheryll,
Thanks for the info.
In that case you can use a custom axis that occupies 5% of the chart for the RSI function. You'll find several examples at All Features\Welcome!\Functions\Financial in the new features demo, available at TeeChart's program group from the binary version. For example: RSI\Calculating RSI, Momentum Div and CLV (Accum/Distrib) examples. You'll also find more information about axes settings in Tutorial 4. Tutorials are also available at TeeChart's program group.
Finally, you might be interested in associating the cursor tool to the candle series:
So, all of this applied to your code, could be something like this:
Hope this helps!
Thanks for the info.
In that case you can use a custom axis that occupies 5% of the chart for the RSI function. You'll find several examples at All Features\Welcome!\Functions\Financial in the new features demo, available at TeeChart's program group from the binary version. For example: RSI\Calculating RSI, Momentum Div and CLV (Accum/Distrib) examples. You'll also find more information about axes settings in Tutorial 4. Tutorials are also available at TeeChart's program group.
Finally, you might be interested in associating the cursor tool to the candle series:
Code: Select all
(Chart_MP.Tools.Items[0] as TCursorTool).Series:=candle1;
Code: Select all
uses Chart, CandleCh, Series, TeeTools, TeEngine;
procedure TForm1.FormCreate(Sender: TObject);
var
Chart_MP: TChart;
candle1: TCandleSeries;
line1: TLineSeries;
rsiFunc1: TRSIFunction;
MyAxis : TChartAxis;
begin
//Application.CreateForm(TForm_MPs, Form_MPs);
Chart_MP:=TChart.Create(Self);
Chart_MP.Parent:=Self;
Chart_MP.Align:=alClient;
Chart_MP.View3D:=false;
Chart_MP.Legend.Visible:=false;
candle1:=Chart_MP.AddSeries(TCandleSeries) as TCandleSeries;
candle1.FillSampleValues;
line1:=Chart_MP.AddSeries(TLineSeries) as TLineSeries;
rsiFunc1:=TRSIFunction.Create(Self);
line1.SetFunction(rsiFunc1);
line1.DataSource:=candle1;
MyAxis := TChartAxis.Create(Chart_MP);
line1.CustomVertAxis := MyAxis;
MyAxis.StartPosition:=95;
MyAxis.EndPosition:=100;
Chart_MP.Axes.Left.EndPosition:=95;
Chart_MP.Tools.Add(TCursorTool);
(Chart_MP.Tools.Items[0] as TCursorTool).Series:=candle1;
//Form_MPs.BringToFront;
//Form_MPs.Show;
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 |
Re: Crosshair - add to CHART?
Hi Narcis,
thank you for your reply.
And now we did it. We have a code now, where the original problem occurs (pls. read original posting).
I send you a screenshot. The split of the axis makes it.
What can I do, that the cursor goes down to the bottom?
I do not have only an RSI. I have several extra axis of which it is hard to see exactly which candle they belong to.
If the cursor tool does not do it, I am grateful for any work-around.
Thanks,
Cheryll
thank you for your reply.
And now we did it. We have a code now, where the original problem occurs (pls. read original posting).
I send you a screenshot. The split of the axis makes it.
What can I do, that the cursor goes down to the bottom?
I do not have only an RSI. I have several extra axis of which it is hard to see exactly which candle they belong to.
If the cursor tool does not do it, I am grateful for any work-around.
Thanks,
Cheryll
- Attachments
-
- CutProblem.jpg (167.69 KiB) Viewed 17652 times
Cheryll
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Crosshair - add to CHART?
Hi Cherryll,
Ok, back to your original question:
You could even try implementing horizontal cursor synchronization similar to what's shown in the All Features\Welcome!\Tools\Cursor\Synchronizing Two in the new features demo, available at TeeChart's program group.
Would that fit your needs?
Ok, back to your original question:
Yes. However, your custom axis scenario doesn't allow this.is it possible to have a crosshair to 2 series
Yes, not assigning it to a specific series. Again, this doesn't apply for such custom axes charts.or to a chart
Yes, you could add another cursor tool associated to the function series, for example:or to a series including its function?
Code: Select all
Chart_MP.Tools.Add(TCursorTool);
(Chart_MP.Tools.Items[1] as TCursorTool).Series:=line1;
Would that 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 |
Re: Crosshair - add to CHART?
Thank you so much!
I love it and have never seen this before, - although I scrolled the features help many times.
I probably will use this for many other purposes as well.
Cheryll
I love it and have never seen this before, - although I scrolled the features help many times.
I probably will use this for many other purposes as well.
Cheryll
Cheryll
Re: Crosshair - add to CHART?
Hello Cheryll,
Thanks for your feedback. We are glad that our suggestion, has worked for you .
Thanks in advance,
Thanks for your feedback. We are glad that our suggestion, has worked for you .
Thanks in advance,
Best Regards,
Sandra Pazos / 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 |