Lazarus

Programming => Graphics and Multimedia => TAChart => Topic started by: arneolav on September 17, 2021, 02:50:05 pm

Title: (Solved) LiveView, problem with ViewPort > 1 and x-axis.
Post by: arneolav on September 17, 2021, 02:50:05 pm
First of all, thanks for the LiveView component, nice work.
As LiveView function is asked for I'm implementing the component (on Lazarus 2.2.0RC1).

I'v run into a problem:
-ViewPort = Active
-ViewportSize > 1
Then the scrolling does not work, the scrollbar is "solid". (See screendump below).
Seems LogicalExtent not is activated?

Bottom Axis, Marks, Source is set to DateTimeIntervalChartSource1.
Chart Series is as default 0. Dynamic created in code.

I've looked into the demo and read thru the documentation and mostly all I can find of discussion but can't find a solution.
Title: Re: LiveView, problem with ViewPort > 1 and x-axis.
Post by: wp on September 17, 2021, 02:59:54 pm
-ViewportSize > 1
The ViewportSize is measured in units of the x axis. Since you have a date/time variable on the x axis, the x axis is scaled in days. Thus, Viewportsize > 1 means that you must collect values during a full until the scrolling becomes active. If you want to see the values arriving during the last, say, hour, then ViewportSize should be 1 hour = 1day / 24 = 1/24, or for during the last minute, it should be 1/(24*60).
Title: Re: LiveView, problem with ViewPort > 1 and x-axis.
Post by: arneolav on September 17, 2021, 06:05:28 pm
Thanks, then it works.

It was my suspicion that the problem had something to do with the timeline.

Got a minor problem with the ColorBelow;
On select active the colorbelow is shown incorrect, just at the end of the line.
On scroll from left to right, the ColorBelow is shown correct in the beginning but replaced by the default series color "pixel by pixel" as the scroll go on.
This not very important!   
Thanks again!

Title: Re: (Solved) LiveView, problem with ViewPort > 1 and x-axis.
Post by: wp on September 17, 2021, 06:46:43 pm
Sorry, I am completely lost for the moment: What do you mean with ColorBelow?
Title: Re: (Solved) LiveView, problem with ViewPort > 1 and x-axis.
Post by: arneolav on September 17, 2021, 08:37:17 pm
Sorry for my bad explanation,

If a point value is below a given value ( a SplitValue)  I call its color "ColorBelow".

Colors are set this way:
LineSeries.AddXY(x,y,name,color);

Look at the picture in the first post, you will see the SeriesLine has changed to blue under a value, in this example  10 degrees.

In a "quick look" a user may see if a critical value has occurred, may be too high or too low, depending on setting of the split value.
Title: Re: (Solved) LiveView, problem with ViewPort > 1 and x-axis.
Post by: wp on September 17, 2021, 09:31:14 pm
Found an incorrect a point index used for determination of the point color in relation with ColorEach of TLineSeries. Fixed in main (trunk). Please test if this fixes your issue.
Title: Re: (Solved) LiveView, problem with ViewPort > 1 and x-axis.
Post by: arneolav on September 17, 2021, 10:27:50 pm
Yes, it did the trick!
Again, thanks a lot!!
Title: Re: (Solved) LiveView, problem with ViewPort > 1 and x-axis.
Post by: wp on September 17, 2021, 10:54:07 pm
OK, merged it to fixes_2_2.
TinyPortal © 2005-2018