Page 1 of 1

Problem with function

Posted: Tue Nov 25, 2014 3:15 pm
by 16669818
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

Re: Problem with function

Posted: Tue Nov 25, 2014 3:46 pm
by yeray
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.

Re: Problem with function

Posted: Wed Nov 26, 2014 8:26 am
by 16669818
Hello, I've edited first post. If you can't reproduce the problem, I'll upload example later.

Re: Problem with function

Posted: Thu Nov 27, 2014 8:16 am
by yeray
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.

Re: Problem with function

Posted: Thu Nov 27, 2014 9:04 am
by 16669818
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.

Re: Problem with function

Posted: Thu Nov 27, 2014 9:53 am
by yeray
Hi,

Try hiding the right axis grid:

Code: Select all

Chart1.axis.right.gridpen.visible = false;

Re: Problem with function

Posted: Thu Nov 27, 2014 10:23 am
by 16669818
I've hidden grid, but there are still multiple "0.214" values on the axis and correlation line drops down when starting to drag.

Re: Problem with function

Posted: Thu Nov 27, 2014 3:37 pm
by narcis
Hi Igor,

What about setting right axis increment, for example:

Code: Select all

Chart1.axis.Right.Increment = 0.01;

Re: Problem with function

Posted: Thu Nov 27, 2014 3:55 pm
by 16669818
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.

Re: Problem with function

Posted: Fri Nov 28, 2014 10:45 am
by yeray
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));

Re: Problem with function

Posted: Fri Nov 28, 2014 2:08 pm
by 16669818
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.

Re: Problem with function

Posted: Fri Nov 28, 2014 3:26 pm
by yeray
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.

Re: Problem with function

Posted: Fri Nov 28, 2014 3:57 pm
by 16669818
Is it normal that I need a trick at all in that situation? Why doesn't it just work?