Problem with function

TeeChart for ActiveX, COM and ASP
Post Reply
Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Problem with function

Post by Igor » Tue Nov 25, 2014 3:15 pm

Hi,
I've got a problem while trying to apply function (one-value-function, like tfCorrelation) on my serie. Right after plotting it looks like this:
Image
But after starting to drag graph with right mouse button right axis looks like this:
Image

Then if I do unzoom movement (left click from bottom-right to up-left) it returns to state on first image.
Thanks in advance
Last edited by Igor on Wed Nov 26, 2014 7:42 am, edited 1 time in total.

Yeray
Site Admin
Site Admin
Posts: 8876
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with function

Post by Yeray » Tue Nov 25, 2014 3:46 pm

Hello,

I can't see the images you tried to add on your post. Could you please try to correct them?
Also, we'll probably need a simple example project we can run as-is to reproduce the problem here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Problem with function

Post by Igor » Wed Nov 26, 2014 8:26 am

Hello, I've edited first post. If you can't reproduce the problem, I'll upload example later.

Yeray
Site Admin
Site Admin
Posts: 8876
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with function

Post by Yeray » Thu Nov 27, 2014 8:16 am

Hello Igor,

Are you linking the different series to different vertical axes?
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Problem with function

Post by Igor » Thu Nov 27, 2014 9:04 am

Hello,
Of course I'm linking different series to different vertical axes. They have different scales, so on one axis they will not be observable. Simple example in attachment, try to drag it.
Attachments
Correlation.zip
(1.5 KiB) Downloaded 313 times

Yeray
Site Admin
Site Admin
Posts: 8876
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with function

Post by Yeray » Thu Nov 27, 2014 9:53 am

Hi,

Try hiding the right axis grid:

Code: Select all

Chart1.axis.right.gridpen.visible = false;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Problem with function

Post by Igor » Thu Nov 27, 2014 10:23 am

I've hidden grid, but there are still multiple "0.214" values on the axis and correlation line drops down when starting to drag.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Problem with function

Post by Narcís » Thu Nov 27, 2014 3:37 pm

Hi Igor,

What about setting right axis increment, for example:

Code: Select all

Chart1.axis.Right.Increment = 0.01;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Problem with function

Post by Igor » Thu Nov 27, 2014 3:55 pm

Have you tried it on your side? When I set increment, I see no label at all at the right axis when starting dragging, and correlation line still drops down.

Yeray
Site Admin
Site Admin
Posts: 8876
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with function

Post by Yeray » Fri Nov 28, 2014 10:45 am

Hello,
Igor wrote:Have you tried it on your side? When I set increment, I see no label at all at the right axis when starting dragging, and correlation line still drops down.
Try adding this at the end of your onLoadFunc. I can scroll the chart here always getting the "0.214" label on the right, with the latest TeeChart ActiveX version published, v2014.0.0.2.

Code: Select all

Chart1.axis.Right.SetMinMax(lineF.YValues.Value(0)-1, lineF.YValues.Value(0)+1);
Chart1.axis.Right.gridpen.visible = false;
Chart1.Axis.Right.Labels.Clear();
Chart1.Axis.Right.Labels.Add(lineF.YValues.Value(0), lineF.YValues.Value(0).toFixed(3));
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Problem with function

Post by Igor » Fri Nov 28, 2014 2:08 pm

Hello,
Thanks for response. Your code works but looks like dirty solution. If I apply more functions to this graph, I'll have to set new axis bounds each time which I didn't mean to do.
I think when right axis is set to automatic, it is not normal behaviour that I see now.

Yeray
Site Admin
Site Admin
Posts: 8876
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with function

Post by Yeray » Fri Nov 28, 2014 3:26 pm

Hello Igor,
Igor wrote:Thanks for response. Your code works but looks like dirty solution. If I apply more functions to this graph, I'll have to set new axis bounds each time which I didn't mean to do.
I think when right axis is set to automatic, it is not normal behaviour that I see now.
Note I suggested this trick because your right axis was in a quite particular situation: a single series assigned to the axis, with all its YValues being the same. This situation is internally handled showing a unique label in the middle of the axis.

If you add more series to the right axis, you shouldn't need such a trick and you can set it to be automatic again.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Problem with function

Post by Igor » Fri Nov 28, 2014 3:57 pm

Is it normal that I need a trick at all in that situation? Why doesn't it just work?

Post Reply