Cross point function. How does it work? Sample?
Cross point function. How does it work? Sample?
Hello,
I have been trying to get the cross point function to work with two existing series. I followed the instructions in the help, but it does not work. I added the cross point as "marks" so I was expecting to see marks when the lines crossed. Is there a simple example of using the cross point function?
In hopes of carrying this a little further...is there a way to apply the cross point function of a series and a "cross line" tool?
Thanks!
I have been trying to get the cross point function to work with two existing series. I followed the instructions in the help, but it does not work. I added the cross point as "marks" so I was expecting to see marks when the lines crossed. Is there a simple example of using the cross point function?
In hopes of carrying this a little further...is there a way to apply the cross point function of a series and a "cross line" tool?
Thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jeff,
Depending on how are you populating the source series you may need to use CheckDataSource method as done here:
Depending on how are you populating the source series you may need to use CheckDataSource method as done here:
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.Series(2).SetFunction tfCrossPoints
TChart1.Series(2).DataSource = "Series0,Series1"
TChart1.Series(0).FillSampleValues 10
TChart1.Series(1).FillSampleValues 10
TChart1.Series(2).CheckDataSource
End Sub
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 |
Thanks. This seems to work, but I need a little more if possible. I want to have the intersections of the points be displayed in chart marks. You know the little yellow rectangles. Right now I have the values displayed in a label. Also...(the biggy)....Does this only work with series or can I create a cross line tool from the tools tab and use that as a datasource?
Thanks!
Private Sub Form_Load()
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.Series(2).SetFunction tfCrossPoints
TChart1.Series(2).DataSource = "Series0,Series1"
TChart1.Series(0).FillSampleValues 10
TChart1.Series(1).FillSampleValues 10
TChart1.Series(2).CheckDataSource
Label1.Caption = TChart1.Series(2).XValues.Value(0) & ", " & TChart1.Series(2).YValues.Value(0)
End Sub
Thanks!
Private Sub Form_Load()
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.Series(2).SetFunction tfCrossPoints
TChart1.Series(2).DataSource = "Series0,Series1"
TChart1.Series(0).FillSampleValues 10
TChart1.Series(1).FillSampleValues 10
TChart1.Series(2).CheckDataSource
Label1.Caption = TChart1.Series(2).XValues.Value(0) & ", " & TChart1.Series(2).YValues.Value(0)
End Sub
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jeff,
Yes, this is possible, you just need to make the function series visible:I want to have the intersections of the points be displayed in chart marks. You know the little yellow rectangles. Right now I have the values displayed in a label
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.Series(2).SetFunction tfCrossPoints
TChart1.Series(2).DataSource = "Series0,Series1"
TChart1.Series(0).FillSampleValues 10
TChart1.Series(1).FillSampleValues 10
TChart1.Series(2).CheckDataSource
TChart1.Series(2).Marks.Visible = Tr1ue
End Sub
Sorry but I'm afraid I don't understand what are you meanning. TeeChart doesn't have cross line tool. Could you please be more specific about that?Also...(the biggy)....Does this only work with series or can I create a cross line tool from the tools tab and use that as a datasource?
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 |
Thanks.
In the Chart Tools Gallery there is a Color Line tool. Right click on the chart, choose edit, choose the Tools tab, click on Add, click on Axis tab. There is the Color Line tool.
Also...the mark works, but how do I get it to display the X and Y value of the point? Sorry...this is extremely new to me.
Thanks!
In the Chart Tools Gallery there is a Color Line tool. Right click on the chart, choose edit, choose the Tools tab, click on Add, click on Axis tab. There is the Color Line tool.
Also...the mark works, but how do I get it to display the X and Y value of the point? Sorry...this is extremely new to me.
Thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jeff,
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Ok, If you want to know which points of a ColorLine tool intersect with a line series you'd better create a fake series (instead of the ColorLinetool) which has a Y constant value for all points and use it as a datasource for the function. For example, if you want a line at 700 Y value you can do something like the code below and make the constant line series visible or not.In the Chart Tools Gallery there is a Color Line tool. Right click on the chart, choose edit, choose the Tools tab, click on Add, click on Axis tab. There is the Color Line tool.
Also...the mark works, but how do I get it to display the X and Y value of the point? Sorry...this is extremely new to me.
Code: Select all
Private Sub Form_Load()
TeeCommander1.Chart = TChart1
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.Series(2).SetFunction tfCrossPoints
TChart1.Series(2).DataSource = "Series0,Series1"
TChart1.Series(0).FillSampleValues 10
TChart1.Series(1).AddXY 0, 700, "", clNone
TChart1.Series(1).AddXY TChart1.Series(0).Count - 1, 700, "", clNone
TChart1.Series(1).Active = False
TChart1.Series(2).CheckDataSource
TChart1.Series(2).Marks.Visible = True
End Sub
It works fine for me here using latest TeeChart Pro v7 ActiveX version available. Which version are you using? If the problem persists, could you please send us an example we can run "as-is" to reproduce the problem here?The above cause a crash when the lines cross. Any ideas why? It appears to be the .CheckDataSource line that bombs.
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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 code you gave me appears to work..BUT...I have two charts on the same form in VB6. I am using TeeChart 6. My problem now is that while the value displays in the "Mark" for one chart. It does not display in my other chart. The code is the same. Do you have any ideas why the code would display marks appropriately in one chart on the same form and not another on the same form?
Just an added note here...
I got this to work by changing this line:
.DataSource = "Series0,Series4" ...to.... .DataSource = "Series0,Series3"
Now...my series should be series 4...so why does it work as series 3?
Thanks!
Just an added note here...
I got this to work by changing this line:
.DataSource = "Series0,Series4" ...to.... .DataSource = "Series0,Series3"
Now...my series should be series 4...so why does it work as series 3?
Thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jeff,
Sorry but I don't understand your exact problem. Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Sorry but I don't understand your exact problem. Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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 |